I've searched everywhere for two days now, still no help.
my project uses jQuery Guillotine Plugin to allow users select image size and position before uploading to my php server but i can't figure out the proper way to crop and scale the image based on the data received from the frontend.
Here is what i've tried:
The response i'm trying to work with looks like this:
{ scale: 0.324, angle: 0, x: 110, y: 34, w: 300, h: 300 }
Then the php code:
$imagick = Image::make($destination . "/" . $fileName);
$height = $imagick->height();
$width = $imagick->width();
$imagick->rotate($req['angle']);
//using the data recieved after user selection
$imagick->cropImage((int)$req['w'], (int)$req['h'], (int)$req['x'], (int)$req['y']);
//Write image to disk
$imagick->save($destinationPathSmaller . $fileName);
At this point, the picture doesn't display correctly. i really don't know what to do, this is my 3rd day on this. please help!
Thanks in inadvance,