So, I’m having trouble figuring out the logic to do the following:
I have a number of images that need to be resized in PhotoShop. I want to script to look at the height and width and determine how to resize the file.
The hard part is that the images may have any proportions, and I want the script to make sure the resized image fits in let’s say a 100 pixel wide by 30 pixel high area.
If the image is really tall or really wide, it’s easy - if it is wider than tall then resize the width to 100 px and if it is taller than wide then resize to 30 px high.
The problem is if the image is is squarish. If the width is slightly larger than the height then resizing the width to 100 px will leave the height well over 30 px.
This doesn’t seem like it should be that hard but for some reason it is escaping me today…
Model: iMacintel
AppleScript: xCode 3.0
Browser: Safari 525.20.1
Operating System: Mac OS X (10.5)