Friday, May 28, 2010
Indexed GIFs Cannot Be Displayed by Browsers
To save everyone else from wasting a day of their life on this, if you're getting "the image cannot be displayed because it contains errors" messages in Firefox, don't spend hours of your life trying to figure out what's wrong with your code. Check the images first. I'm working on an application that displays images (GIFs) from a document scanning system, and due to where the images are located in relation to the webapp, I'm using CFCONTENT to display them. No matter what I tried, I could not get the images to display properly. After much head bashing (my poor wall) I decided to grab some of the images directly. To my surprise, they couldn't even be displayed in the default image viewer in Ubuntu. The GIMP to the rescue. I opened one of the GIFs in GIMP and they're all indexed GIFs. I changed the mode from indexed to grayscale and saved the GIF, and voila, all is right with the world. So my very hard learned lesson of today is that indexed GIFs cannot be displayed by browsers. Good thing it's a long weekend and Open Source Bridge is next week, because clearly I need a break.