Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

how can i change the image size from pixels to % (percent)?


tordeman

Recommended Posts

Please explain in a little more detail what it is you are trying to acomplish.

Are you trying to do this to product images? You want to make them 50% of their original size or the tabletheir placed in? If you give more detail, someone may be able to answer your question.

 

Regards

Wayne Wetterhahn

Link to comment
Share on other sites

  • 8 months later...

I want to know how to do this as well. The admin only allows entering info in pixels for image size. How can you enter a percent number? I have a lot of images that are different sizes. Having them all reduced to 50% of their width and height looks much better than having everything reduced to 100 pixels wide (for example).

 

Please help!!

Link to comment
Share on other sites

  • 1 year later...

I found a way around this problem:

 

Simply set either the image width to what you want it and make the height field blank (or vice versa). That resizes all the images to either the same width or height (depending on what you left blank).

 

What I'm looking for is a way to hack the products_new.php file to display images at a specified height or width. In other words I would like to replace SMALL_IMAGE_WIDTH and/or SMALL_IMAGE_HEIGHT with the correct code to make it equavalent to height="whatever I want" and/or width="whatever I want":

 

<td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $products_new['products_image'], $products_new['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?></td>

 

Any takers?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...