Reply to Re: Resize in percentage

Re: Resize in percentage new!
by colin, 15 years, 6 months ago
I may implement such a feature in a future release. In the meantime, you can simply read image_src_x and image_src_y before calling process(), and act accordingly. For instance:

$handle = new Upload($_FILES['xxxx']);
if ($handle->uploaded) {
    $handle->image_convert = 'jpg';
    $handle->image_resize = true;
    $handle->image_ratio = true;
    $handle->image_x = $handle->image_src_x / 2; // 50%
    $handle->image_y = $handle->image_src_y / 2; // 50%
    $handle->Process("images/");
    $handle->Clean();
}
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