Images Rendering in Firefox but not IE
What do you do with images that render in Firefox fine, but appear as a red cross in Internet Explorer 6 & 7?
I was recently making West Lindsey Churches Festival 2009 website. Systematic Print, the company who designed and printed the brochure for the event, had supplied me with a DVD-R of all of the images used in the brochure, as large TIFs. Since there were 82 churches, obviously I wanted to batch convert these to 200pixel-wide JPEGs. My first port of call was ImageMagick's command-line convert utility. This appeared to work, except that the resulting JPEGs all seemed to be 500kB bigger than expected. (Even a 1x1 image was over 500kB). This was fixed using mogrify with the -strip parameter instead of convert.
All was going well until the site was tested in Internet Explorer 6 and 7, both of which didn't like these strange JPEGs, and kindly rendered red crosses instead. This is strange, as every other program (Firefox, GIMP, Windows Image & Fax Viewer etc) could render them fine.
My next port of call was GIMP. If an image converted by GIMP could be rendered by IE, then I could use GIMP's command-line batch mode to process all 82 images. In fact, there is already a set of Perl scripts called batchgimp would do the trick. Unfortunately, IE refused to render the images created by GIMP too.
In the end I had to reboot to Windows and download Irfanview, a free image viewing and editing program, which unfortunately doesn't "just run" under Wine. It has a batch mode that can be accessed by pressing the B key on the keyboard. I then ran ren *.jpg *.tif.jpg (Warning: globbing works differently in Windows shells. This can only done with a for loop in bash) on the resulting images to give them the names that convert had made, and used WinSCP to copy them direct to the webserver, overwriting the old images.
The moral of the story: Always check your websites in multiple browsers. Strange things can happen even if you dont't have any CSS or fancy stuff. And if you have strange images, give Irfanview a try. It worked for me.




comments