Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

macmesser

macrumors 6502a
Original poster
Aug 13, 2012
921
198
Long Island, NY USA
Let's say I want to display uncropped images at 600 pixels wide and 400 pixels high (aspect ratio = 1.5) for the landscape orientation images and at 400 pixels wide and 600 pixels high (ar=.67) for the portrait orientation images. For a cropped image of any other aspect ratio I'd want to display it resized proportionately so that the longest dimension is 600 pixels.

Using PHP, CSS , Javascript in any combination, is there some way to do this on a dynamically generated web page without actually passing the aspect ratio of a given image along with it's file path?

Thanks for any insights.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.