Reply to Re: Image Resize option future

Re: Image Resize option future new!
by Cassiano Rabelo, 17 years, 4 months ago
What if I want the image to have always 70px in height by whatever width (keeping the ratio, of course).
This is the code I'm using:

$handle = new Upload('input.jpg');
$handle->file_overwrite  = TRUE;
$handle->file_auto_rename  = FALSE;
$handle->file_safe_name = false;
$handle->image_resize = TRUE;
$handle->image_ratio_no_zoom_in = TRUE;
$handle->image_y = 70;
$handle->file_new_name_body = 'output';
$handle->Process(PATH_IMGS);

I tried this and it works on most of my images, but I have one image with 1130x450 that ends up with 150x59.
One way to fix this is to use a "fake" image_x really huge (12000 for instance), but I dont know if this might have an side effect.
How should this be done? Do I need an "if" to test the sizes first?
Thank you once again for the great class.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