Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Portrait & Landscape Category Images


ChrisW123

Recommended Posts

If your categories have a mixture of Landscape images (wider then they are tall) and Portrait images (taller then they are wide), this "trick" will make the Portrait image height equal to the height of the setting in Admin, instead of the height of landscape images. To correct this:

 

Edit includes/functions/html_output.php. Find:

 

if ($image_size = @getimagesize($src)) {

 

And add this below it:

 

// If this is a "portrait" image, swap the $width and $height values
// so the image is shown at the correct size.
if ($width == SMALL_IMAGE_WIDTH && $height == SMALL_IMAGE_HEIGHT) {
  if ($image_size[1] > $image_size[0]) {
     $width = SMALL_IMAGE_HEIGHT;
     $height = SMALL_IMAGE_WIDTH;
   }
}

Link to comment
Share on other sites

  • 3 weeks later...

I've tried to use this mod on my store, but it doesn't make any difference. Maybe I'm doing it wrong. Can you elaborate on pasting this into my file? I don't know much about PHP, but the indentations aren't consistent. Does that matter?

 

Thanks for any help you can provide. If you'd like to see my store, send me a PM. It's still a work in progress.

Link to comment
Share on other sites

I've tried to use this mod on my store, but it doesn't make any difference. Maybe I'm doing it wrong. Can you elaborate on pasting this into my file? I don't know much about PHP, but the indentations aren't consistent. Does that matter?

 

Thanks for any help you can provide. If you'd like to see my store, send me a PM. It's still a work in progress.

 

Steve,

 

I just realized that your tep_image() function in html_output.php is probably different from mine. That's because I installed "OnTheFlyThumbnail" contribution which changed the function to something new. So that's probably the problem. Hahaha, sorry about that, it's been a while. :)

 

So most likely, to use this mod you'll need to install OnTheFlyThumbnail first. It's well worth the effort. The contribution effeciently sizes thumbnail images to save bandwidth, etc. Check it out.

 

-Chris.

Link to comment
Share on other sites

  • 3 months later...
Steve,

 

I just realized that your tep_image() function in html_output.php is probably different from mine.  That's because I installed "OnTheFlyThumbnail" contribution which changed the function to something new.  So that's probably the problem.  Hahaha, sorry about that, it's been a while. :)

 

So most likely, to use this mod you'll need to install OnTheFlyThumbnail first.  It's well worth the effort.  The contribution effeciently sizes thumbnail images to save bandwidth, etc.  Check it out.

 

-Chris.

 

Hi There:

 

This looked like the answer to my question of how to get landscape and portrait images to look correct. However, I cannot find the OnTheFlyThumbnail. Where is it located?

 

Thank you,

Rosalind

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...