I am trying to find some code that will check the height and width (in pixels) of an image and then, if it is bigger than MY specified width (say I set the maximum size and 640 pixels wide and 480 pixels tall) it will **proportionally** resize it down. Like using the 'Image > Resize > Image Size...' function in Photoshop. If the image was 700px by 500px, the script would see that both the x and y are larger than the limit, so it would make the image 640px by 457px. Anyone have any idea how to do this? I looked all over for 'php, gd, resize image' and a bunch of other stuff, but I just kept getting a bunch of thumbnail generators.
Some old code of mine for making phone themes does that. You can grab the source form http://www.pfym.com/ (go to the page first - I think I put hotlink protection on for that site and if so it will stop direct downloads of the zip files). themeauto.php and image.php are the code files to look for image resizing in.
(ignore the mention of hosting on that page - I no longer offer hosting but haven't bothered to update that site)