Welcome Guest, Not a member yet? Register   Sign In
Getting Verot's class.upload to resize an image with a max-height?
#1

[eluser]Unknown[/eluser]
So, I have to create an image gallery and I'm trying to use Verot.net's "class.upload.php" class to do so. I have figured out resizing on the x-scale, but now when an image is larger on the y-scale that the x-scale it get's really big (of course). How would I create something like a "max-width:" thing, so that it get's no bigger than 960*720?

Thank you,
Egill
#2

[eluser]danmontgomery[/eluser]
http://www.verot.net/res/sources/class.upload.html

Quote:# image_max_width if set to a dimension in pixels, the upload will be invalid if the image width is greater (default: null)

$handle->image_max_width = 200;

# image_max_height if set to a dimension in pixels, the upload will be invalid if the image height is greater (default: null)

$handle->image_max_height = 100;
#3

[eluser]danmontgomery[/eluser]
Err, double post... Sorry
#4

[eluser]Unknown[/eluser]
[quote author="noctrum" date="1267245825"]http://www.verot.net/res/sources/class.upload.html

Quote:# image_max_width if set to a dimension in pixels, the upload will be invalid if the image width is greater (default: null)

$handle->image_max_width = 200;

# image_max_height if set to a dimension in pixels, the upload will be invalid if the image height is greater (default: null)

$handle->image_max_height = 100;
[/quote]


Well, I had tried that, but what that does is that it makes the uploading invalid if the height is more than 100. So, if I were to select a file, 350*350, I'd get an error.




Theme © iAndrew 2016 - Forum software by © MyBB