[jira] [Commented] (IMAGING-97) Fails to read most Sony A100 JPG files generated from Photoshop CS2

2023-12-08 Thread Bruno P. Kinoshita (Jira)


[ 
https://issues.apache.org/jira/browse/IMAGING-97?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17794868#comment-17794868
 ] 

Bruno P. Kinoshita commented on IMAGING-97:
---

There are at least five markers ignored by the JpegDecoder, and that I think 
would have to be handled in order to get valid/similar output. I compared the 
HTML dump of exiftool, and the ImageIO and Imaging files are very different. I 
thought this would be a one day task, but it seems it would take a lot longer 
to implement and test it well. :(

> 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: New Feature
>  Components: Format: JPEG
>Affects Versions: 1.0-alpha1
> Environment: Windows 7, JDK1.7, Imaging snapshot build from 20121013
>Reporter: William Saar
>Priority: Major
> Fix For: Patch Needed
>
> Attachments: _DSC6099.jpg, image-2023-12-08-19-06-37-909.png
>
>
> 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 was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (IMAGING-97) Fails to read most Sony A100 JPG files generated from Photoshop CS2

2023-12-08 Thread Bruno P. Kinoshita (Jira)


[ 
https://issues.apache.org/jira/browse/IMAGING-97?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17794823#comment-17794823
 ] 

Bruno P. Kinoshita commented on IMAGING-97:
---

Comparing the BufferedImage created by ImageIO and Imaging for the same JPEG 
seems to be a good way to tell what's different, and then step back and start 
debugging it.

!image-2023-12-08-19-06-37-909.png|width=686,height=753!

> 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: New Feature
>  Components: Format: JPEG
>Affects Versions: 1.0-alpha1
> Environment: Windows 7, JDK1.7, Imaging snapshot build from 20121013
>Reporter: William Saar
>Priority: Major
> Fix For: Patch Needed
>
> Attachments: _DSC6099.jpg, image-2023-12-08-19-06-37-909.png
>
>
> 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 was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (IMAGING-97) Fails to read most Sony A100 JPG files generated from Photoshop CS2

2023-12-08 Thread Bruno P. Kinoshita (Jira)


[ 
https://issues.apache.org/jira/browse/IMAGING-97?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17794780#comment-17794780
 ] 

Bruno P. Kinoshita commented on IMAGING-97:
---

The branch in the comments above has been merged already. There is no 
exception, but the written output is invalid (see linked issue by Gary).

Looking at exiftool's output, I can see resolution unit, metadata, and data of 
the original image are gone / reduced.

> 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: New Feature
>  Components: Format: JPEG
>Affects Versions: 1.0-alpha1
> Environment: Windows 7, JDK1.7, Imaging snapshot build from 20121013
>Reporter: William Saar
>Priority: Major
> Fix For: Patch Needed
>
> 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 was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (IMAGING-97) Fails to read most Sony A100 JPG files generated from Photoshop CS2

2023-12-08 Thread Bruno P. Kinoshita (Jira)


[ 
https://issues.apache.org/jira/browse/IMAGING-97?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17794772#comment-17794772
 ] 

Bruno P. Kinoshita commented on IMAGING-97:
---

Issue reproduced using `master` branch, 
0ffcd1bd9e06e95f4483519575f1f163ac64ef5d, following code snippet:
{code:java}
 package org.apache.commons.imaging;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.InputStream;

public class ABC {
public static void main(String[] args) throws Exception {
// JpegImagingParameters jpgDecodeParams = new JpegImagingParameters();
InputStream compressedThumbnailData = 
ABC.class.getResourceAsStream("/data/images/jpg/7/_DSC6099.jpg");
BufferedImage img = Imaging.getBufferedImage(compressedThumbnailData);
ImageIO.write(img, "JPEG", new File("/home/kinow/Desktop/test.jpg"));
}
}
{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: New Feature
>  Components: Format: JPEG
>Affects Versions: 1.0-alpha1
> Environment: Windows 7, JDK1.7, Imaging snapshot build from 20121013
>Reporter: William Saar
>Priority: Major
> Fix For: Patch Needed
>
> 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 was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (IMAGING-97) Fails to read most Sony A100 JPG files generated from Photoshop CS2

2023-11-17 Thread Gary Lucas (Jira)


[ 
https://issues.apache.org/jira/browse/IMAGING-97?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17787232#comment-17787232
 ] 

Gary Lucas commented on IMAGING-97:
---

I just entered Issue-368 describing problems I've seen with the file  
_DSC6099.jpg that was contributed to Imaging's JUnit test suite following on 
this Jira item.  The image reader doesn't crash, but it fails to properly 
decode the image.  If anyone has suggestions, I might have time to look at 
this.   

> 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: New Feature
>  Components: Format: JPEG
>Affects Versions: 1.0-alpha1
> Environment: Windows 7, JDK1.7, Imaging snapshot build from 20121013
>Reporter: William Saar
>Priority: Major
> Fix For: Patch Needed
>
> 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 was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (IMAGING-97) Fails to read most Sony A100 JPG files generated from Photoshop CS2

2015-03-09 Thread JIRA

[ 
https://issues.apache.org/jira/browse/IMAGING-97?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14353519#comment-14353519
 ] 

Michael Groß commented on IMAGING-97:
-

Updated my proposal at 
http://github.com/mgmechanics/commons-imaging/tree/IMAGING-134: With my patch 
commons-imaging can read JPEG image files which contain RST markers.

 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: New Feature
  Components: Format: JPEG
Affects Versions: 1.0
 Environment: Windows 7, JDK1.7, Imaging snapshot build from 20121013
Reporter: William Saar
 Fix For: Patch Needed

 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 was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (IMAGING-97) Fails to read most Sony A100 JPG files generated from Photoshop CS2

2015-02-24 Thread JIRA

[ 
https://issues.apache.org/jira/browse/IMAGING-97?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14335440#comment-14335440
 ] 

Michael Groß commented on IMAGING-97:
-

This problem is caused by RST markers fond among image data. They are legal 
there. Thanks for the example, it was very helpful.

Added RST and DRI markers to a proposed patch. This patch also throws a 
exceptions with a proper message if the entropy data (= encoded image data) 
contain RST markers so that everyone knows whats going on.
http://github.com/mgmechanics/commons-imaging/tree/IMAGING-134

According to http://stackoverflow.com/questions/8748671/jpeg-restart-markers 
this issue affects images saved with Photoshop: File-Save As-jpeg.

 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: New Feature
  Components: Format: JPEG
Affects Versions: 1.0
 Environment: Windows 7, JDK1.7, Imaging snapshot build from 20121013
Reporter: William Saar
 Fix For: Patch Needed

 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 was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (IMAGING-97) Fails to read most Sony A100 JPG files generated from Photoshop CS2

2015-02-22 Thread JIRA

[ 
https://issues.apache.org/jira/browse/IMAGING-97?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14332367#comment-14332367
 ] 

Michael Groß commented on IMAGING-97:
-

Examined IMAGING-134 and found that this issue and IMAGING-134 have the same 
cause: A variable called *b2* in 
*org.apache.commons.imaging.formats.jpeg.decoder.JpegInputStream.nextBit()* has 
not the value 220 as expected but 208.

 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: New Feature
  Components: Format: JPEG
Affects Versions: 1.0
 Environment: Windows 7, JDK1.7, Imaging snapshot build from 20121013
Reporter: William Saar
 Fix For: Patch Needed

 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 was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (IMAGING-97) Fails to read most Sony A100 JPG files generated from Photoshop CS2

2012-12-03 Thread Damjan Jovanovic (JIRA)

[ 
https://issues.apache.org/jira/browse/IMAGING-97?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=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

2012-11-14 Thread Adrian Moerchen (JIRA)

[ 
https://issues.apache.org/jira/browse/IMAGING-97?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=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] [Commented] (IMAGING-97) Fails to read most Sony A100 JPG files generated from Photoshop CS2

2012-11-14 Thread Adrian Moerchen (JIRA)

[ 
https://issues.apache.org/jira/browse/IMAGING-97?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=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