Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Small Images - can I use percentages instead of pixels??


samsamsam

Recommended Posts

Hi again fellow osC'ers. I'd like to know if I can edit the small image width and height options to be actual percentages of the original image instead of the actual size in pixels.

 

Is this at all possible?

 

thanks

Link to comment
Share on other sites

Sam,

 

Almost anything is possible.....whether it's advisable is another story. What are you trying to accomplish with the small images?

Link to comment
Share on other sites

Thanks for your reply. I just want my small images to be proportional to the original, larger ones. The pixel height and width settings may not be proportional with every image. Do you know what I mean?

Link to comment
Share on other sites

Ah! I understand completely. The easiest way to accomplish that is to simply "turn off" one of the settings in the admin. If you set the width to 100 and the height to 0, then all of your pictures will be 100px wide by the correct porportion high.

 

I personally like using the width so that the images don't push any of my boxes out of shape.

Link to comment
Share on other sites

  • 3 months later...

I tried setting the height or width to zero and the image was just 1 pixel high/wide (whichever I tried). If I got rid of the value all together, the image displayed at it's original height.

 

The way I'm doing images is reading the path in from a DB (v_products_image) variable. Is this why it's not working properly?

Link to comment
Share on other sites

i personally make two set of images, 1 set small and 1 set large, and in the images folder i make a folder called enlarge and place my larger images in it. then i open up popup_image.php and change

<?php echo tep_image(DIR_WS_IMAGES

 

to

 

<?php echo tep_image(DIR_XS_IMAGES

 

and save that

 

then i open the includes/configure.php file and add

 

  define('DIR_XS_IMAGES', 'images/enlarge/'); // enlarged images folder

 

for this to work both sets of images must have the same name

 

 

myimage.jpg myimage.jpg

100x80 450x370

 

then i leave the image sizes in the admin setting blank. and let the images display as they are default . :roll:

 

basically with this you get "what ya see is what ya get effect"

 

 

if ya got a lot of images find a program to "batch" them for you

:!: first rule: Allways make a backup of a file before you change it. & All code is CASE Sensitive

:!: second rule: Never copy and paist code unless you know it works.

:!: third rule: If you do not know ask.

:!: final rule: Have patience.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...