Reply to Re: crop using coordinates?

Re: crop using coordinates? new!
by colin, 15 years, 4 months ago
I see what you mean. You will have to use the new dev version 0.27RC1. This version adds a parameter called image_precrop, which works as image_crop except that it crops the image before any resizing.

Here is how your code should look like with 0.27RC1:

$upload->image_resize = true;
$upload->jpeg_quality = 85;
$upload->image_precrop = array($_POST["y1"], $upload->image_src_x - $_POST["x2"], $upload->image_src_y - $_POST["y2"], $_POST["x1"]);
$upload->image_x = 197;
$upload->image_y = 70;

Note that you don't need any image_ratio... here, as your selected area will always be proportional to 197x70.Reply

Your reply

Name *
Email 
Title *
Text *
CAPTCHA image
Enter the code displayed on the image:
Click on the image to generate another one if it is hard to read it. The case is important