class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
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
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.