Copy link to clipboard
Copied
I have an online store, some of the image file names have a space in them. This still displays fine in FireFox but not in IE. I tried to replace the space with a %20 thinking that this will render the image in IE and it still does not show in IE but will show in FireFox w/ the %20.
Here is my code:
<cfset sImage3 = "#reReplace(SImage,' ', '%20 ', 'all')#" >
<IMG SRC="#Trim(sImage3)#" BORDER="0" >
Any suggestions?
Copy link to clipboard
Copied
Instead of a regular expression, try using the built-in function, URLEncodedFormat:
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=functions_t-z_10.html
It should do the trick for you.
Copy link to clipboard
Copied
I changed the code to read: <IMG SRC="product-images/small/#URLEncodedFormat(Trim(sImage2))#" BORDER="0">
The image still only displays in FireFox but not in IE.
When looking at the source for the image it reads the following:
FireFox: http://lightsunlimitedinc.com/product-images/small/4404%20GR%2EJPG
IE: http://lightsunlimitedinc.com/product-images/small/4404%20GR.JPG
Copy link to clipboard
Copied
I was only able to see the image in Safari (Mac and PC). I could not see it in IE 8, IE 7, Firefox 3 (Win) and Google Chrome 1. In Firefox 3 on Windows, I got an error message:
The image “http://lightsunlimitedinc.com/product-images/small/4404%20GR%2EJPG” cannot be displayed, because it contains errors.
I then downloaded the image from Safari (since I could see it in this browser) and checked it's properties. According to the file information, the image was saved with the CMYK color space. This is not supported in most browsers and I believe that's the issue and not the file name's format.
If you are able, I would recommend grabbing the above file/image from the server. Then, edit it in an image editing program such as Photoshop or Fireworks (ensuring that you save it with the RGB color space and not CMYK). Finally, upload it to the server, overwriting your existing image, and open the above URL in your browsers. You should now be able to see the image in Internet Explorer (IE does not support CMYK images) and other browsers.
Copy link to clipboard
Copied
That does seem to be the problem I downloaded a couple of test images, opened them in PhotoShop and resaved/upload and I can now see the images. the problem I have now is there are around 130,000 images that will need to be batched and saved and reuploaded. Not looking forward to this.
thanks
Copy link to clipboard
Copied
Oh, man, that's brutal! Are you familiar with creating actions/batches in Photoshop? If not, check into them, it could save you some serious headache!!