September 30th, 2012, 03:14 PM
Smart Image Sizing
I'm working with a datafeed which I pull images from.
The images are all in different sizes and I'm trying to show them in small 100x100 icons on my site.
The problem is that most icons looks very bad because the original image is not a square and it gets distorted when I fit it to the dimentions of one.
I would like to be able to change wide images to width=60px and tall images to height=60px.
What whould be the best way (and easier on my server) to do this?
Should I do this on the server side or maybe CSS could offer me that option?
September 30th, 2012, 05:13 PM
Probably server-side. If you need PHP code on how to do this, Google for generic image resizing: most things you'll find talk about using a maximum width or height rather than forcing both to a number (and thus skewing the image).