Problem: Someone emails you an image file. You can see the thumbnail fine in Gmail, so you save it to your hard drive. But when you try to view the image in Firefox, you get this error instead: The image “file:///C:/Documents%20and%20Settings/whatever.jpg” cannot be displayed, because it contains errors. Paint.net and Photoshop can view it. Re-saving the file in Paint.net works; re-saving in Photoshop doesn’t work. What’s going on?
Solution: You got an JPEG which uses CMYK instead of RGB encoding, and Firefox/IE choke on such files. In Photoshop, you can convert the JPGs to RGB colorspace, or you can select “Save For Web…” to make the file valid for common browsers.
- When you get a weird error message, do an exact search for that error message, e.g. “cannot be displayed, because it contains errors”.
- If you write software, make your error messages as descriptive as possible. Something like “This image is in CMYK color space, so you’re screwed, buddy. Try converting it to RGB instead.” That’s much more helpful than “your file contains errors,” especially since it isn’t really an error. Other programs handle JPEGs like that just fine.