Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Image thumbnails distorted depite using packages f


bobbruce

Recommended Posts

Posted

I have uploaded product images about 200 x300 size. This size being the required enlarged size. The images are a mixture of landscape and portrait and so a single thumbnail size setting will not keep all the aspect ratios.

 

I have tried 2 packages from the contribution section but this appears to have no effect. I have tried leaving out or adding a 0 setting for the height or width which just causes the full size image to display instead of a thumbnail.

 

Is there a solution that will work? The Configuration/Images setting just seem to overide anything else.

Posted

Try this: In catalog/includes/functions/html_output.php, find the function tep_image()

and just after

 if (tep_not_null($width) && tep_not_null($height)) {

add this:

//BOF for homothetic image
if ($get_size_image = @getimagesize($src)) {
?$ratio_image_product = $get_size_image[0]/$get_size_image[1];
?$ratio_image_print = $width/$height;
?if ($ratio_image_product > $ratio_image_print) {
? ?$height = $width / $ratio_image_product;
?} 
?elseif ($ratio_image_product < $ratio_image_print) {
? ?$width = $height * $ratio_image_product;
?}
}
// EOF

Now, sets the width AND the height of the images and it will be OK...

 

Regards...

JeanLuc

OsC: MS2

Posted

Hi I tell ya what I did with my images ... Go to Configuration in your oscommerce cataloge admin, then go to the images page ... I set small image height to 100 but didnt set a small image width, so just leave that blank as all images are different widths. Also I used a program called Image Thumbnailer and Converter version 2.26. All that did the trick for me. Hope this helps you out!

 

Kind regards

Emma :D

Posted
Hi I tell ya what I did with my images ... Go to Configuration in your oscommerce cataloge admin,  then go to the images page ... I set small image height to 100 but didnt set a small image width, so just leave that blank as all images are different widths.  Also I used a program called Image Thumbnailer and Converter version 2.26.  All that did the trick for me.  Hope this helps you out!

 

Kind regards

Emma  :D

Yeah this worked for me, the products do look more decent. I will try those two other software you suggest. What do you do with them, make all the images the same size?

 

Thanks

Posted

Thanks for all the offers of help. Could someone tell me if I'm missing something here. I want my full size images to be about 200 x 300. ( I have no problem resizing images etc and have necessary tools to do this)

 

If I upload the product image at this size, the program creates the thumbnail by scaling it down to the size specified in the small image dimensions. If I only set one dimension, it just displays it at full size, which is far too big for product listings etc. If I set both dimensions it distorts wider images, if I set none it displays the image full size again.

 

How do I get the thumbnails to display with the correct aspect ratio, and have the image zoom to full size when clicked?

 

If I am being thick, please feel free to tell me. I have tried other contributions, but they seem to have no effect.

Posted

Bob is having the exact same problem that I am. I've tried all of these suggestions and the contributions, but my small pictures all appear squashed.

 

I have a program to make thumbnails, but after they're made, what do I do with them? How do I get the catalog to show the thumbnails and then the large image when you "click for larger image"?

 

Does anybody know what we're talking about?

Posted

Well, I fixed my particular problem. I went into PhotoShop and increased the shortest side of each canvas (not the picture itself) to match the pixel length of the longest side. Then I filled in the extra canvas with white. I set the small image width and height to 100 each, uploaded the new pictures, and ... ta daaa! The thumbnails are now proportional.

 

I'm a happy camper. :D

Posted

Thats exactly what I did - even the 100 x 100 pixel size. I gave up with trying the contributions, absolutely nothing worked for me. :rolleyes:

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...