java buffered image created with red mask

前端 未结 6 1687
忘了有多久
忘了有多久 2020-12-04 02:49

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         


        
6条回答
  •  無奈伤痛
    2020-12-04 03:22

    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.

提交回复
热议问题