Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Thumbnail images skewed


Paycheck

Recommended Posts

HI all, I have a successfull cart running version 2.2 and I am always plagued with this small issue. WHen I use images in the catagories section of the site it always skews the images. Why can't the code be written to constrain based on one or the other dimension not to exceed a certain configured size, say 80 pixels wide or tall, but contrain the properties of that image for use in the thumbnails.

 

Any help or direction is great as I have searched with no results pertaining to this question.

 

THank you

 

JM

Always remember, we need patience, guidance and most of all understanding.

 

My Contributions

Link to comment
Share on other sites

In my Configuration -- Images section in admin Ive got the following settings -

 

Image width = 0

Image height = 80

Calculate image size = true

 

For me this keeps the thumbnails from getting stretched or squashed. They will never go over 80 pixels high. One thing to look out for though is if you had a really wide image, so try not to use anything thats too wide compared to its height. Or too high compared to its width.

 

Hope that works for you,

 

Rob

Does this smell like chloroform to you?

Link to comment
Share on other sites

OK I uploaded image_resize.php and changed the code in the html_outpot.php file as required however now my image links are all broken. It has to do with the new code under line 71 of the html_output.php file here...

 

They say in the install file of

 

INSTALL img_resample

 

You need:

 Linux or some other *nix

 

 download and install NetPBM and NetPBM-progs. they're on rpmfind.net

 

 gunzip and untar the img_resample.tar.gz -file

 (it should be in the /catalog/includes/functions folder and be named image_resample.php)

 

 open your html_output.php (in the same folder as you put resample.php)

 

 go to approx line no 73 which is something like this:

////

// The HTML image wrapper function

 function tep_image($src, $alt = '', $width = '', $height = '', $params = '') {

   if ( (($src == '') || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false') ) {

     return '';

   }

 

-AFTER- these lines you add:

 

   if ( ($width == SMALL_IMAGE_WIDTH && $height == SMALL_IMAGE_HEIGHT) || $resample ) {

    include DIR_FS_CATALOG . "/" . DIR_WS_FUNCTIONS . "image_resample.php";  

   }

 

(three lines of code)

 

Now it should work if your netpbm programs are installed correctly

 

////

// The HTML image wrapper function

 function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') {

   if ( (empty($src) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false') ) {

     return false;

   }

   

  if ( ($width == SMALL_IMAGE_WIDTH && $height == SMALL_IMAGE_HEIGHT) || $resample ) {

    include DIR_FS_CATALOG . "/" . DIR_WS_FUNCTIONS . "image_resample.php";  

   }

 

This breaks the images link and I am a bit confused as to where I go to re-establish that link in this code.

 

Thanks

 

JM

Always remember, we need patience, guidance and most of all understanding.

 

My Contributions

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...