Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Automatic thumbnail error image issue


sowens

Recommended Posts

Posted

Firstly and excelent contrib and it must be saving the world zillions of gb in bandwidth.

 

My problem is. When we have a image that has been uploaded and its name has spaces in it the auto thumbnailer is issuing the error image. The images are all jpgs. When I go to the details screen the image still in error as I would expect and when I do a click to enlarge the image is fine. When i check the properties of the image they have %20's in the file name which indicates they have spaces in the original. Is there an exception I can write for this and if so where in the code is the error created for the error image.

 

Link to the pages where the issue is manifesting itself.

Beleek China Error Image

 

Thank you for reading this.

 

Cheers

Sean

Sean Owens

Posted

There is two scenarios I ran across with this that produce errors:

 

1. If you have spaces in the image name

 

2. If the image name contains characters like & $.

 

There really isn't an easy solution for this, as it is a limitation of most of the automatic thumbnail contributions. Best advice I have would be to ensure the image names don't have any of the above in them, or get some to reprogram the contribution so it:

 

1. When images are uploaded via admin, it will automaticaly rename them to productID.jpg

 

That would resolve the issue entirely and I have high hopes we will see that in the future of oscommerce. Problem with the current system is there is too much room for customer error when they upload photos.

 

Have one customer who uses a digital cam to take product photos. Problem though is that when she unloads them onto her computer, since the naming structure is the same everytime she fills her storage up on the camera, she ends up over writing previously uploading images with the same name without evven realizing it. Ugh....try explaining to a customer with little knowledge how to get around that one :)

Sincerely,

Bruce

 

19 contributions submitted

Posted

Hi

thanks for the help and suggestions.

 

I found a really neat solution to this. I put in a few debug statements and found that it products_thumb the error was coming from the fact the image name was not right going into product thumb.

 

So I went back to html_output and found that if I encoded the file name being passed the spaces would be converted to %20's etc.

 

So the fix is

Find the line in html_output.php that call product_thumb.php

change img='.$src.' ....

to img='.urlencode($src).'....

 

Cheers

Sean

 

 

There is two scenarios I ran across with this that produce errors:

 

1. If you have spaces in the image name

 

2. If the image name contains characters like & $.

 

There really isn't an easy solution for this, as it is a limitation of most of the automatic thumbnail contributions. Best advice I have would be to ensure the image names don't have any of the above in them, or get some to reprogram the contribution so it:

 

1. When images are uploaded via admin, it will automaticaly rename them to productID.jpg

 

That would resolve the issue entirely and I have high hopes we will see that in the future of oscommerce. Problem with the current system is there is too much room for customer error when they upload photos.

 

Have one customer who uses a digital cam to take product photos. Problem though is that when she unloads them onto her computer, since the naming structure is the same everytime she fills her storage up on the camera, she ends up over writing previously uploading images with the same name without evven realizing it. Ugh....try explaining to a customer with little knowledge how to get around that one :)

Sean Owens

Archived

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

×
×
  • Create New...