Image crop
Image crop
hi all,
sory for creating new topic here....
i need some script so only i created new topic....
very urgent i need this to done my project...
sory for creating new topic here....
i need some script so only i created new topic....
very urgent i need this to done my project...
-
- Posts: 36
- Joined: 2010-02-21T18:02:40-07:00
- Authentication code: 8675308
Re: Image crop
What are you trying to do exactly?
To crop, use the Crop command in Magick++:
To crop, use the Crop command in Magick++:
Code: Select all
// Crop the image to specified size (width, height, xOffset, yOffset)
image.crop( Geometry(100,100, 100, 100) );
Re: Image crop
i need this script : http://www.fbphotomagic.com/uploadphoto
its very urjent within 2days i need to summit my project....
its very urjent within 2days i need to summit my project....
Re: Image crop
ya i have try this but i didn't understat...
can u plz do like that...
can u plz do like that...
Re: Image crop
This should get you started:
Code: Select all
<?php
// If the form has been submitted do this
if ( isset( $_POST['Submit'] ) ){
// Temporary upload image name
$original_image = $_FILES['filename']['tmp_name'];
// Name to save the image as - in this case the same as the original
$new_image = $_FILES['filename']['name'];
$size = getimagesize ($original_image);
// crop out the images and save
$cmd = "$original_image -gravity northwest".
" ( +clone -crop 100x200+20+125 -write 1.jpg +delete ) ".
" ( +clone -crop 100x40+140+205 -write 2.jpg +delete ) ".
" ( +clone -crop 100x40+250+205 -write 3.jpg +delete ) ".
" ( +clone -crop 100x40+360+205 -write 4.jpg +delete ) ".
" -crop 100x40+470+220 5.jpg ";
exec("convert $cmd ");
$cmd = " -size {$size[0]}x{$size[1]} xc:white".
" 1.jpg -geometry +20+125 -composite ".
" 2.jpg -geometry +140+205 -composite ".
" 3.jpg -geometry +250+205 -composite ".
" 4.jpg -geometry +360+205 -composite ".
" 5.jpg -geometry +470+205 -composite +repage";
exec("convert $cmd $new_image");
echo "File uploaded<br>";
}
else { ?>
<p>File to upload:</p>
<form method="post" action="<?php echo $PHP_SELF; ?>" enctype="multipart/form-data">
<input type="file" name="filename" />
<input type="Submit" name="Submit" value="Submit" />
</form>
<?php }; ?>
Re: Image crop
Warning: exec() has been disabled for security reasons in /www/99k.org/s/t/e/XXXXX/htdocs/Profile Design/main page/upload.php on line 21
Warning: exec() has been disabled for security reasons in /www/99k.org/s/t/e/XXXXX/htdocs/Profile Design/main page/upload.php on line 30
File uploaded
Warning: exec() has been disabled for security reasons in /www/99k.org/s/t/e/XXXXX/htdocs/Profile Design/main page/upload.php on line 30
File uploaded
Re: Image crop
How did you intend on running the code as you may be able to use Imagick which does not use exec( ) or Magickwand for php but I do not use them and so can not do an example.
If you want to use exec( ) you will either have to ask the hosts to allow it and confirm safe mode is off or change hosts.
Mistake in the code anyway as I forgot to escape the ( ) for linux.
If you want to use exec( ) you will either have to ask the hosts to allow it and confirm safe mode is off or change hosts.
Mistake in the code anyway as I forgot to escape the ( ) for linux.
Code: Select all
<?php
// If the form has been submitted do this
if ( isset( $_POST['Submit'] ) ){
// Temporary upload image name
$original_image = $_FILES['filename']['tmp_name'];
// Name to save the image as - in this case the same as the original
$new_image = $_FILES['filename']['name'];
$size = getimagesize ($original_image);
// crop out the images and save
$cmd = "$original_image -gravity northwest".
" \( +clone -crop 100x200+20+125 -write 1.jpg +delete \) ".
" \( +clone -crop 100x40+140+205 -write 2.jpg +delete \) ".
" \( +clone -crop 100x40+250+205 -write 3.jpg +delete \) ".
" \( +clone -crop 100x40+360+205 -write 4.jpg +delete \) ".
" -crop 100x40+470+220 5.jpg ";
exec("convert $cmd ");
$cmd = " -size {$size[0]}x{$size[1]} xc:white".
" 1.jpg -geometry +20+125 -composite ".
" 2.jpg -geometry +140+205 -composite ".
" 3.jpg -geometry +250+205 -composite ".
" 4.jpg -geometry +360+205 -composite ".
" 5.jpg -geometry +470+205 -composite +repage";
exec("convert $cmd $new_image");
echo "File uploaded<br>";
}
else { ?>
<p>File to upload:</p>
<form method="post" action="<?php echo $PHP_SELF; ?>" enctype="multipart/form-data">
<input type="file" name="filename" />
<input type="Submit" name="Submit" value="Submit" />
</form>
<?php }; ?>
Re: Image crop
no also same error bro.....
add me in skype tool ID : rptnaren
add me in skype tool ID : rptnaren
Re: Image crop
I am afraid I do not use Skype or any chat programs and as I said if you want to use my php method you need to get exec( ) allowed and safe mode turned off.
There is system( ) and passthru( ) but I assume that if exec( ) is turned off they will be as well - exec is the prefered method.
There is Imagick which does not use exec( ) but you need to have that installed and I do not use it so you would need to work out your own code. It is not very well documented.
The php page for it is: http://php.net/manual/en/book.imagick.php
I think this is the guy who is writing Imagick: http://valokuva.org/?cat=1
I do not know how to run Freds scripts on the server without php but that is a possiblity if you can do that.
There is system( ) and passthru( ) but I assume that if exec( ) is turned off they will be as well - exec is the prefered method.
There is Imagick which does not use exec( ) but you need to have that installed and I do not use it so you would need to work out your own code. It is not very well documented.
The php page for it is: http://php.net/manual/en/book.imagick.php
I think this is the guy who is writing Imagick: http://valokuva.org/?cat=1
I do not know how to run Freds scripts on the server without php but that is a possiblity if you can do that.
Re: Image crop
can u create like this for fbml script
Re: Image crop
I can not but somebody may be able to - probably not here - but you could create another thread about that.can u create like this for fbml script
Re: Image crop
where i can create a new topic
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Image crop
click Developers at the top of the page ( or Return To Developers at the bottom of this page) and then click New Topic button.
Re: Image crop
Hi bonzo,
thanks, you script work for me!!! great work!!!
Can you recommend to me a script for modify the area crop? http://www.hotscripts.com/blog/javascri ... g-scripts/
how can i select diferent area with the javascript image cropping scripts?
Regards.
thanks, you script work for me!!! great work!!!
Can you recommend to me a script for modify the area crop? http://www.hotscripts.com/blog/javascri ... g-scripts/
how can i select diferent area with the javascript image cropping scripts?
Regards.