Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Image size


carloscanas

Recommended Posts

Posted

We are setting up a new store and need some suggestions about the image size. Our problem is that some images look fine while some look distorted. Is it there a general rule that we must follow in setting up our product images?

 

Thanks

Posted

One thing you need to do is to maintain the aspect ratio of the picture. Unfortunatly, when you display say a product in the product_info.php, it's sets it to a specific width / height size which may not match the size of the picture that you have.

 

I think the default size that is set is 100x80 for the small pictures in product_info which you can adjust in the admin panel. So, one thing you can do is make sure your pictures match the size settings that your site is set to.

 

However, I found a little trick. It's kind of a pain to half to resize all of your images to match the OSC size in order to maintain the aspect. So what I did was simply modified the code in the product_info to only set the width and it takes care of the height and magicaly maintains the aspect ratio of the image.

 

Here's the orginal code from product_info

 

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>

</noscript>

 

And here's what I modified it to:

 

<?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], '230', '', 'hspace="5" vspace="5"'); ?>

 

I don't use the popup image thing but I think you can get the basic idea. Just replace the "SMALL_IMAGE_WIDTH" with the actuall width that you want and leave the "SMALL_IMAGE_HEIGHT" blank ' '.

 

Seems to work for me...

Hope this helps.

Shayne

Posted

This mod works pretty good. The image of the item selected appears as the set with, 130 in my case.

 

Now, is there a way to set this for the catalog? So all the products are defined by a set width and an open height?

 

Also, with this mod I want to keep the Enalrge Image option.

I modded the code and kept the enlarge option, but now it enlarges to the last opened size window od IE and not the set size of the image.

Is there a way to maintain the aspect of the image size once enlarged and have the window maintain the image size?

 

My code;

<noscript>

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']), '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], '130', '', 'hspace="5" vspace="5"'). '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>

 

</noscript>

 

Thanks

Posted

Never mind.

I got it.

 

 

<noscript>

<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], '130', '', 'hspace="5" vspace="5"'). '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>

 

</noscript>

 

Now just need to find the catagory settings and do the same thing there. (fingers crossed)

Posted

I found the other files.

 

Search "SMALL_IMAGE_WIDTH".

 

\catalog\includes\modules\new_products.php

\catalog\includes\boxes\whats_new.php

\catalog\special.php

Posted
I found the other files.

 

Search "SMALL_IMAGE_WIDTH".

 

\catalog\includes\modules\new_products.php

\catalog\includes\boxes\whats_new.php

\catalog\special.php

 

 

One more;

 

\catalog\includes\modules\product_listing.php

 

\catalog\includes\modules\new_products.php

\catalog\includes\boxes\whats_new.php

\catalog\special.php

Archived

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

×
×
  • Create New...