Cut the rose with PHP help

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
myspacee
Posts: 153
Joined: 2007-06-14T02:09:35-07:00

Cut the rose with PHP help

Post by myspacee »

Hello,
at job we have modify a PHP that allow to our user to upload->crop an image

with floating area user can select a small portion of image and then commit cut.
Final result is a txt file with some info that are parsed from a script that do things.

one of thing to do is cut select area, post an image to explain our goal:

Image

Our PHP return 4 usefull info, coord for point A and point B. From these we can obtain also C and D coordinates.

Now, how i can script a cut that return my roses in right way ?

thank you for any info,
m.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Cut the rose with PHP help

Post by Bonzo »

So the values for A and B are in a text file; these are being read into php variables

If so you need to seperate the two values within A and B then:

Code: Select all

$width = Bx-Ax;
$height = By-Ay;
exec("convert rose -crop +$widthx+$height$Ax+$Ay output.jpg");
Post Reply