This is just one example and I'm not trying to solve this specific exception. I'm interested to know if there is a general way to strip out all of the "abnormal" metadata / garbage from an image so that it is as "plain jane" as possible. The convert -strip option looks promising. At the end of the day, the more cruft we can remove from an image, but still preserve the important aspects of the image format, the better.java.awt.color.CMMException: Invalid image format
at sun.awt.color.CMM.checkStatus(CMM.java:131)
at sun.awt.color.ICC_Transform.<init>(ICC_Transform.java:89)
at java.awt.image.ColorConvertOp.filter(ColorConvertOp.java:516)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.acceptPixels(JPEGImageReader.java:1169)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.readImage(Native Method)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(JPEGImageReader.java:1137)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:948)
at javax.imageio.ImageReader.read(ImageReader.java:923)
Any advice welcome.