How to resize an image to fit in a desired space.
With this script you can upload images
In the submit form you can provide
the max height and max width needed.
After submitting the uploaded image
file will be resized to the new
max height and max width provided.
On the http://www.get-on-top.com/image_resize/resize.php
you can find the Example form
you can also find the php code for the script.
This may help, as may other examples on the page:
The question is how you want to deal with the width/height: Is the height the max? The width? Whichever is smaller? Larger? Doing some simple tests of $w>$h, etc will determine that, then you just need to decide what to do. Usually, it makes sense to find which is larger, then make the image that dimension at 100px (or whatever limit you choose), and have the other scaled smaller, relatively.
Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum