I am having trouble reading an image. If I do the following
URL url = new URL(\"http://tctechcrunch2011.files.wordpress.com/2012/10/gmm.jpg\");
ImageInputSt
As mentioned in other answers, this is a known bug in the standard JPEG plugin that comes bundled with ImageIO and the Oracle JRE.
However, it's possible to continue to use ImageIO as in the OP's original code, by replacing the JPEG plugin with the TwelveMonkeys ImageIO JPEG plugin. You only need to add the JAR and its dependencies to the runtime classpath. No code changes necessary (I tested with the OP's test files).
The plugin is especially made to work around or fix the many issues with the standard JPEG plugin. It supports CMYK JPEGs, broken ICC profiles, Exif data and more. The plugin is developed by me, and is freely distributable under the open source BSD license.