Thank you very much for this information and please bear with me as I need some more advice.
When I run the above on images coming in, I get .75 for images coming in with a 3/4 aspect ration and 1.333... for images coming in with a 4x3 aspect ratio. My system accepts images that are supposed to be either 3x4 or 4x3, allowing for a little bit of fudging because it seems that photoshop seems to size a bit differently than ImageMagick would.
So I am trying to determine if an image is 3 or more pixels outside of the 3x4 or 4x3 aspect ratio before resizing to hard coded sizes, and if it is too much outside the pre-determined aspect ratio, we will kick it out.
My plan is to do the following against the incoming images:
Given the information provided by "%[fx:w/h]", such as .75, multiply that against the height if the image is taller than wide, resulting in the width if it is truly 3x4:
image_s3x4.jpg JPEG 510x680
(.75 x 680) / .75 x height
Given the information provided by "%[fx:w/h]", such as .75, multiply that against the width if the image is wider than tall, resulting in the height if it is truly 4x3:
image_s4x3.jpg JPEG 3072x2304
(.75 x 3072) / .75 x width
And then, I plan to take the value provided, width or height, and see if it is more than 2 or so pixels off, determining if the incoming image is not quite fitting into a 3x4 or 4x3 image ratio.
Pardon the long post, but I'm essentially trying to determine if incoming images are "close" to a 3x4 or 4x3 image ratio, and any advice regarding my technique would be greatly appreciated.