Image crop

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Image crop

Post by Bonzo »

Not quite sure what you want to do as the javascript programs just work on one crop per image.
I have used Javascript Image Cropper UI and either it already uses Imagemagick or I modified it but can not remember and no longer have the code.
userman
Posts: 12
Joined: 2010-09-12T10:58:46-07:00
Authentication code: 8675308

Re: Image crop

Post by userman »

Hi bonzo,

I want 5 crop per image.

you can check it in http://fbphotomagic.com/uploadphoto uploading a image....
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Image crop

Post by Bonzo »

The code I posted actualy produces the cropped images:

Code: Select all

$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 ";
If you wanted you could replace the positions in the above code with variables. You would need to calculate the variables from the positions passed from the javascript code.
Post Reply