You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "William Saar (JIRA)" <ji...@apache.org> on 2012/11/02 00:54:13 UTC
[jira] [Created] (IMAGING-97) Fails to read most Sony A100 JPG
files generated from Photoshop CS2
William Saar created IMAGING-97:
-----------------------------------
Summary: Fails to read most Sony A100 JPG files generated from Photoshop CS2
Key: IMAGING-97
URL: https://issues.apache.org/jira/browse/IMAGING-97
Project: Commons Imaging
Issue Type: Bug
Components: Format: JPEG
Affects Versions: 1.0
Environment: Windows 7, JDK1.7, Imaging snapshot build from 20121013
Reporter: William Saar
Attachments: _DSC6099.jpg
This line fails with the exception at the bottom for most of my old JPG files shot with a Sony A100, and sometimes processed by Photoshop CS2. I will attach a failing file.
BufferedImage img = Imaging.getBufferedImage(compressedThumbnailData, jpgDecodeParams);
where jpgDecodeParams are
ImagingConstants.BUFFERED_IMAGE_FACTORY, new RgbBufferedImageFactory()
ImagingConstants.PARAM_KEY_FORMAT, ImageFormat.IMAGE_FORMAT_JPEG
Exception:
org.apache.commons.imaging.ImageReadException: Invalid marker found in entropy data
at org.apache.commons.imaging.formats.jpeg.decoder.JpegInputStream.nextBit(JpegInputStream.java:50)
at org.apache.commons.imaging.formats.jpeg.decoder.JpegDecoder.decode(JpegDecoder.java:417)
at org.apache.commons.imaging.formats.jpeg.decoder.JpegDecoder.readMCU(JpegDecoder.java:311)
at org.apache.commons.imaging.formats.jpeg.decoder.JpegDecoder.visitSOS(JpegDecoder.java:122)
at org.apache.commons.imaging.formats.jpeg.JpegUtils.traverseJFIF(JpegUtils.java:83)
at org.apache.commons.imaging.formats.jpeg.decoder.JpegDecoder.decode(JpegDecoder.java:428)
at org.apache.commons.imaging.formats.jpeg.JpegImageParser.getBufferedImage(JpegImageParser.java:95)
at org.apache.commons.imaging.Imaging.getBufferedImage(Imaging.java:1375)
at org.apache.commons.imaging.Imaging.getBufferedImage(Imaging.java:1315)
at
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (IMAGING-97) Fails to read most Sony A100 JPG
files generated from Photoshop CS2
Posted by "Damjan Jovanovic (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/IMAGING-97?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13509491#comment-13509491 ]
Damjan Jovanovic commented on IMAGING-97:
-----------------------------------------
Imaging's ability to read images from JPEG files is still at an early stage, as documented in src/site/xdoc/formatsupport.xml. ImageIO is a better bet for now.
> Fails to read most Sony A100 JPG files generated from Photoshop CS2
> --------------------------------------------------------------------
>
> Key: IMAGING-97
> URL: https://issues.apache.org/jira/browse/IMAGING-97
> Project: Commons Imaging
> Issue Type: Bug
> Components: Format: JPEG
> Affects Versions: 1.0
> Environment: Windows 7, JDK1.7, Imaging snapshot build from 20121013
> Reporter: William Saar
> Attachments: _DSC6099.jpg
>
>
> This line fails with the exception at the bottom for most of my old JPG files shot with a Sony A100, and sometimes processed by Photoshop CS2. I will attach a failing file.
> BufferedImage img = Imaging.getBufferedImage(compressedThumbnailData, jpgDecodeParams);
> where jpgDecodeParams are
> ImagingConstants.BUFFERED_IMAGE_FACTORY, new RgbBufferedImageFactory()
> ImagingConstants.PARAM_KEY_FORMAT, ImageFormat.IMAGE_FORMAT_JPEG
> Exception:
> org.apache.commons.imaging.ImageReadException: Invalid marker found in entropy data
> at org.apache.commons.imaging.formats.jpeg.decoder.JpegInputStream.nextBit(JpegInputStream.java:50)
> at org.apache.commons.imaging.formats.jpeg.decoder.JpegDecoder.decode(JpegDecoder.java:417)
> at org.apache.commons.imaging.formats.jpeg.decoder.JpegDecoder.readMCU(JpegDecoder.java:311)
> at org.apache.commons.imaging.formats.jpeg.decoder.JpegDecoder.visitSOS(JpegDecoder.java:122)
> at org.apache.commons.imaging.formats.jpeg.JpegUtils.traverseJFIF(JpegUtils.java:83)
> at org.apache.commons.imaging.formats.jpeg.decoder.JpegDecoder.decode(JpegDecoder.java:428)
> at org.apache.commons.imaging.formats.jpeg.JpegImageParser.getBufferedImage(JpegImageParser.java:95)
> at org.apache.commons.imaging.Imaging.getBufferedImage(Imaging.java:1375)
> at org.apache.commons.imaging.Imaging.getBufferedImage(Imaging.java:1315)
> at
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (IMAGING-97) Fails to read most Sony A100 JPG
files generated from Photoshop CS2
Posted by "Adrian Moerchen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/IMAGING-97?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496985#comment-13496985 ]
Adrian Moerchen commented on IMAGING-97:
----------------------------------------
Found a workaround (at least for us) for this:
{code};
/**
* Converts the byte array to an image.
*
* @param data
* Image as binary data.
* @return Returns a BufferedImage object or null.
*/
public static BufferedImage byteToImage(byte[] data) {
try {
return Imaging.getBufferedImage(data);
} catch (IOException e) {
LOGGER.warn("Error reading image: {}", e.getMessage());
} catch (ImageReadException e) {
LOGGER.warn("Error reading image: {}", e.getMessage());
try {
return ImageIO.read(new ByteArrayInputStream(data));
} catch (IOException e1) {
LOGGER.warn("Error reading image: {} ", e1.getMessage());
}
}
return null;
}
{code}
> Fails to read most Sony A100 JPG files generated from Photoshop CS2
> --------------------------------------------------------------------
>
> Key: IMAGING-97
> URL: https://issues.apache.org/jira/browse/IMAGING-97
> Project: Commons Imaging
> Issue Type: Bug
> Components: Format: JPEG
> Affects Versions: 1.0
> Environment: Windows 7, JDK1.7, Imaging snapshot build from 20121013
> Reporter: William Saar
> Attachments: _DSC6099.jpg
>
>
> This line fails with the exception at the bottom for most of my old JPG files shot with a Sony A100, and sometimes processed by Photoshop CS2. I will attach a failing file.
> BufferedImage img = Imaging.getBufferedImage(compressedThumbnailData, jpgDecodeParams);
> where jpgDecodeParams are
> ImagingConstants.BUFFERED_IMAGE_FACTORY, new RgbBufferedImageFactory()
> ImagingConstants.PARAM_KEY_FORMAT, ImageFormat.IMAGE_FORMAT_JPEG
> Exception:
> org.apache.commons.imaging.ImageReadException: Invalid marker found in entropy data
> at org.apache.commons.imaging.formats.jpeg.decoder.JpegInputStream.nextBit(JpegInputStream.java:50)
> at org.apache.commons.imaging.formats.jpeg.decoder.JpegDecoder.decode(JpegDecoder.java:417)
> at org.apache.commons.imaging.formats.jpeg.decoder.JpegDecoder.readMCU(JpegDecoder.java:311)
> at org.apache.commons.imaging.formats.jpeg.decoder.JpegDecoder.visitSOS(JpegDecoder.java:122)
> at org.apache.commons.imaging.formats.jpeg.JpegUtils.traverseJFIF(JpegUtils.java:83)
> at org.apache.commons.imaging.formats.jpeg.decoder.JpegDecoder.decode(JpegDecoder.java:428)
> at org.apache.commons.imaging.formats.jpeg.JpegImageParser.getBufferedImage(JpegImageParser.java:95)
> at org.apache.commons.imaging.Imaging.getBufferedImage(Imaging.java:1375)
> at org.apache.commons.imaging.Imaging.getBufferedImage(Imaging.java:1315)
> at
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (IMAGING-97) Fails to read most Sony A100 JPG
files generated from Photoshop CS2
Posted by "Adrian Moerchen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/IMAGING-97?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496966#comment-13496966 ]
Adrian Moerchen commented on IMAGING-97:
----------------------------------------
We've got the same error with images taken with Samsung Galaxy SII (GT-I9100).
> Fails to read most Sony A100 JPG files generated from Photoshop CS2
> --------------------------------------------------------------------
>
> Key: IMAGING-97
> URL: https://issues.apache.org/jira/browse/IMAGING-97
> Project: Commons Imaging
> Issue Type: Bug
> Components: Format: JPEG
> Affects Versions: 1.0
> Environment: Windows 7, JDK1.7, Imaging snapshot build from 20121013
> Reporter: William Saar
> Attachments: _DSC6099.jpg
>
>
> This line fails with the exception at the bottom for most of my old JPG files shot with a Sony A100, and sometimes processed by Photoshop CS2. I will attach a failing file.
> BufferedImage img = Imaging.getBufferedImage(compressedThumbnailData, jpgDecodeParams);
> where jpgDecodeParams are
> ImagingConstants.BUFFERED_IMAGE_FACTORY, new RgbBufferedImageFactory()
> ImagingConstants.PARAM_KEY_FORMAT, ImageFormat.IMAGE_FORMAT_JPEG
> Exception:
> org.apache.commons.imaging.ImageReadException: Invalid marker found in entropy data
> at org.apache.commons.imaging.formats.jpeg.decoder.JpegInputStream.nextBit(JpegInputStream.java:50)
> at org.apache.commons.imaging.formats.jpeg.decoder.JpegDecoder.decode(JpegDecoder.java:417)
> at org.apache.commons.imaging.formats.jpeg.decoder.JpegDecoder.readMCU(JpegDecoder.java:311)
> at org.apache.commons.imaging.formats.jpeg.decoder.JpegDecoder.visitSOS(JpegDecoder.java:122)
> at org.apache.commons.imaging.formats.jpeg.JpegUtils.traverseJFIF(JpegUtils.java:83)
> at org.apache.commons.imaging.formats.jpeg.decoder.JpegDecoder.decode(JpegDecoder.java:428)
> at org.apache.commons.imaging.formats.jpeg.JpegImageParser.getBufferedImage(JpegImageParser.java:95)
> at org.apache.commons.imaging.Imaging.getBufferedImage(Imaging.java:1375)
> at org.apache.commons.imaging.Imaging.getBufferedImage(Imaging.java:1315)
> at
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (IMAGING-97) Fails to read most Sony A100 JPG
files generated from Photoshop CS2
Posted by "William Saar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/IMAGING-97?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
William Saar updated IMAGING-97:
--------------------------------
Attachment: _DSC6099.jpg
File that causes Imaging to throw the exception.
> Fails to read most Sony A100 JPG files generated from Photoshop CS2
> --------------------------------------------------------------------
>
> Key: IMAGING-97
> URL: https://issues.apache.org/jira/browse/IMAGING-97
> Project: Commons Imaging
> Issue Type: Bug
> Components: Format: JPEG
> Affects Versions: 1.0
> Environment: Windows 7, JDK1.7, Imaging snapshot build from 20121013
> Reporter: William Saar
> Attachments: _DSC6099.jpg
>
>
> This line fails with the exception at the bottom for most of my old JPG files shot with a Sony A100, and sometimes processed by Photoshop CS2. I will attach a failing file.
> BufferedImage img = Imaging.getBufferedImage(compressedThumbnailData, jpgDecodeParams);
> where jpgDecodeParams are
> ImagingConstants.BUFFERED_IMAGE_FACTORY, new RgbBufferedImageFactory()
> ImagingConstants.PARAM_KEY_FORMAT, ImageFormat.IMAGE_FORMAT_JPEG
> Exception:
> org.apache.commons.imaging.ImageReadException: Invalid marker found in entropy data
> at org.apache.commons.imaging.formats.jpeg.decoder.JpegInputStream.nextBit(JpegInputStream.java:50)
> at org.apache.commons.imaging.formats.jpeg.decoder.JpegDecoder.decode(JpegDecoder.java:417)
> at org.apache.commons.imaging.formats.jpeg.decoder.JpegDecoder.readMCU(JpegDecoder.java:311)
> at org.apache.commons.imaging.formats.jpeg.decoder.JpegDecoder.visitSOS(JpegDecoder.java:122)
> at org.apache.commons.imaging.formats.jpeg.JpegUtils.traverseJFIF(JpegUtils.java:83)
> at org.apache.commons.imaging.formats.jpeg.decoder.JpegDecoder.decode(JpegDecoder.java:428)
> at org.apache.commons.imaging.formats.jpeg.JpegImageParser.getBufferedImage(JpegImageParser.java:95)
> at org.apache.commons.imaging.Imaging.getBufferedImage(Imaging.java:1375)
> at org.apache.commons.imaging.Imaging.getBufferedImage(Imaging.java:1315)
> at
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira