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.
Hi there, When I want to resize an image, I want the script to see if it has to deal with a landscape image or a portrait one. When it's a landscape image, it has to become 600 px wide (ratio_y). When it's a portait, I want it to be 500 px high (ratio_x). How do I do that?Reply
Hi Colin, thnx for te reply. I'm not much of a coder but I do understand what you mean, altough it doesn't work here...
When I read $foo->image_src_x after "if $foo->uploaded == true" I get a value of "0". When I read it after $foo->process(), it returns the correct x-value, but than I can't change the variables to get the difference between landscape and portrait...
Perhaps this has something to do with the open_basedir restrictions altough I don't know what you mean by that.Reply
When I want to resize an image, I want the script to see if it has to deal with a landscape image or a portrait one. When it's a landscape image, it has to become 600 px wide (ratio_y). When it's a portait, I want it to be 500 px high (ratio_x).
How do I do that?
Instantiate the class first, and then if $foo->uploaded == true, you can read the following variables:
Then, you can call $foo->process() with different parameters, depending on the variables above.
Note that this will not work if open_basedir restrictions are in place.
I'm not much of a coder but I do understand what you mean, altough it doesn't work here...
When I read $foo->image_src_x after "if $foo->uploaded == true" I get a value of "0". When I read it after $foo->process(), it returns the correct x-value, but than I can't change the variables to get the difference between landscape and portrait...
Perhaps this has something to do with the open_basedir restrictions altough I don't know what you mean by that.
Then, if it still doesn't work, can you provide us with a link to your phpinfo()?
Thnx mate.