You are here:  » How to restrict Image Sizes

Support Forum



How to restrict Image Sizes

Submitted by shoppersbase on Tue, 2011-11-29 16:38 in

Hi David

I have seen several coinsurance of where a product images are abnormally large and i think its because the width and height has been set. i could be wrong

Please take a look at this page {link saved}

You can see that the 5th Related products has a large image. How do I reduce this and keep the image width and height the same throughout the site. also the image is a direct feed via Amazon API but before i go LIVE with this site it will be nice to tidy it up.

Thanks

Joseph

Submitted by support on Tue, 2011-11-29 17:14

Hi Joseph,

When scaling images in HTML, it's always best to fix either width _or_ height, but not both. Otherwise, the image would appear distorted.

What has happened here is that one of your product images happens to be particularly tall, so whilst its width is fixed in html/searchresults.php it still happens to be quite tall.

An alternative to specifying width='...' would be to use a max-width: and max-height: style tag. In that file, look for where the width is specified by the following attribute of the img tag within line 10:

width='80'

...and try REPLACEing that with:

style='max-width:80px;max-height:80px;'

Hope this helps!

Cheers,
David.
--
PriceTapestry.com