Page 1 of 1

crop an image and save it

Posted: Tue Feb 17, 2009 6:19 am
by fabby
Hi.
I want, when someone want to upload a picture, to crop to resize to 800px x 600px and if is larger when i resizeit, to crop. Then, the result i want to upload on the server.
It is possible that?
Thanks.

Re: crop an image and save it

Posted: Tue Feb 17, 2009 9:18 am
by panic!
Yes it is possible.

http://uk.php.net/gd

Re: crop an image and save it

Posted: Tue Feb 17, 2009 3:05 pm
by Stacks
Also look into imagick.

You will need to install the imagick pecl module.

Instructions can be found at http://valokuva.org/

Once installed it's as easy as

Code: Select all

 
    $image = new Imagick($file_name);
    $image->cropThumbnailImage(800, 600);
    $image->writeImage($new_file_name);