[ic] Specify cat image size

Peter peter at pajamian.dhs.org
Mon Apr 26 07:31:51 EDT 2004

Aftermarket Cellular wrote:
> Hi,
> Is there any way to specify the image width and height of thumbnails in the
> "cat" table? My category pages are loading very slowly and I think this will
> help a bit. I am using Interchange 4.8.6.

It won't help the page load any faster and newer browsers are pretty 
good at displaying the page as the images are being loaded even if it 
doesn't know the image sizes in advance.  Older browsers such as 
Netscape Communicator will simply not display the page until all the 
images that don't have WIDTH and HEIGHT attributes in the tag are 
loaded.  Note that in either case it does not affect the speed that the 
page or the images load in.  At any rate:

Three ways I know of, all have thier good and bad sides.

1.  If all your thumbnails have the same dimensions and you know they 
will have the same dimensions for all future thumbnails, you can 
hardcode WIDTH and HEIGHT attributes into the IMG tags on the search 
results page.  This won't work if your thumbnails have different dimensions.

2.  Use an image library to load up each of the images as the image tags 
are being generated and display them.  I highly recommend against this 
as it will put a very heavy load on your server's CPU and will slow down 
the page generation noticably.  If enough people try to access the cat 
at once it could grind your server to a near standstill.  You'd probably 
have to write a usertag to fetch the image off of the server's HDD and 
read in the width and height.

3.  Add thumbx and thumby columns to your products table and store the 
width and height of the thumbnails in it, then the search results page 
simply has to put the values from these columns into the IMG tag as 
WIDTH and HEIGHT attributes.  This requires a lot of data entry for all 
your existing thumbnails and future thumbnails but you can ease that 
burden by using an image library to grab these values and enter them in 
the table for you at the time the thumbnails are uploaded.

I'm not going into any details on exactly what steps you would have to 
go through for this because i just don't have the time to research it 
and figure it all out now, but this will at least get you on the right 


More information about the interchange-users mailing list