|Thumbnails - how do you do it?|
There is a huge number of products in my database with every image practically a different size. How do you set thumbnail sizes. I've currently got them fixed at width="70" height="80" but obviously they look awful when crammed into the space.
How do you make them all the same height (they can't be over 80 due to page layout) but allow them to find their own suitable width so that the image looks okay?
for me, we use 150 but the principle is the same, i make them either 150 wide or high whichever is the greater.
i also manually change some that are square in shape as they end up looking much bigger than the others, around 125 x 125 for us works,
also we manually review the thumnail picture, sometimes a straight 'shrink' from the full size works, othertimes we need to crop the full size pic or else the thumbnail is meaningless... more work but worth it, and before you ask we have 50k product images on the site, so although not a huge number enough for it to be a lot of work.
We use the perl module ImageMagick to resize the images on upload and save both a thumbnail version and an enlarged version. This allows the thumbnail page to load quickly. Depending on your images, it may be better to set the width or height, you won't get both in an automated process. The only way you can get a standard size is to manually pre-crop the image prior to upload, a tedious process. ImageMagick will crop images but being automated it may not be a good idea.
I have a site where users can upload images. It creates 2 files for each upload. One is the original scaled down to 600xscale and the other is 100xscale.
I made a PHP script that reads the original size and scales accordingly. Basically, it reads the original size. Let's say an image is 640x480. Then it resizes to 600 x [(600/640)*480] or 600x450. It does the same process to get 100 x [(100/640)*480] or 100x75. They are saved in a format like 0001.jpg and t0001.jpg and called as needed.
You could use a similar script to view your pictures in scale. Just remember that you can either set your height or width but not both without a chance of distortion.
thotor sizes to height or width, maintains aspect ration, plus its thumbnails are significantly smaller than photoshops for example. Thotor is a tiny windows app, but also runs fine under wine in linux. It's free, get it here [dominativ.com].
I havent' tried the new version, but the old version works great, and always has. Small app that does one thing very well.
<added>Checked out the new version, works even better in wine, now also supports creating more than thumbnails, same easy to use interface.
This wouldn't be a solution for a server side processing thing of course, it's a client app.
I think you can use imagemagick if I remember right though by just setting max heights for the image when processing it, and setting the other dimension as some large number as a max value.