Thumbnails and Auto Thumbnailer
I never realised until today that the thumbnails in osCommerce product pages aren’t actual thumbnails but use HTML height and width attributes to constrain the image! My client called asking how she could have both very wide/non tall thumbnails and also square ones. At the time I assumed osCommerce resized and created a thumbnail on upload, but after having a look and running a couple of tests I realised this wasn’t the case! I always wondered why some thumbnails didn’t look sharp compared to the originals.
Considering how simple it is to resize photos in PHP I’m very suprised that osCommerce doesn’t do this. Perhaps the new version will, but for now a contribution will do the job just as well. I came across the Automatic Thumbnailer which doesn’t create thumbnails when you add the product to the database, but it creates one when the product photo is first viewed (be it on the product’s page, what’s new or other section). It creates a thumbnail image using the sizes set in your configuration for the maximum height or width. The thumbnails are still kept in proportion but this time they’re resized and kept sharp. I’ve run it on a test site and it does the job fine so I’m hoping it’ll work well with the new site too.
Also just one page to edit with a small section of code to paste in, so very easy to add in and will cut down on bandwidth usage too.
Auto Insurance Quote save money in minutes

[...] osCommerce Blog Just another WordPress weblog « Thumbnails and Auto Thumbnailer Image Alt Attributes » [...]
September 14th, 2006 at 11:14 pm
[...] Because of the product photos in use, some are long and narrow, others are square. Not ideal really, but we’ve got to work around these issues. So the product results and product info page has to be displayed in a different manor to the usual image on the left, detail on the right. Plus the Auto thumbnailer doesn’t seem to be working on the main product photo, just the extra photos and the search results pages. So a bit more PHP investigating is needed, along with still having to fix the Customer Title issues. [...]
October 4th, 2006 at 4:14 pm
[...] When we first installed the auto thumbnailer contribution it worked fine, absolutely perfectly. However after installing the other contributions I noticed that even though the extra pics were resizing on the page, the main product image wasn’t, but it was in the product listings and search results. So I sat down today and ran through the PHP code for the contribution to see what had altered. I had a nagging feeling in my mind that the More Pics contribution had overwritten something that the Auto Thumbnailer was relying on. [...]
October 29th, 2006 at 6:00 pm
I’m searching this plugin: Picture size must small at Homepage(index.php), When cilck link(it will open single.php) it will be large size picture. How can i do this or which plugin like this? Thanks..
February 1st, 2008 at 11:16 am
Hi Yazili, I’m not 100% sure of a contribution that does what you’re after. The auto thumbnail one mentioned in this post will resize the images cleanly and then on the product page when you click the image it’ll open in a new window and show the larger version. To be fair, you could probably set this up using a combination of this plugin and a little extra coding on the front page to link the images on that page.
February 7th, 2008 at 9:05 am