commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicolas Desessart (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (IMAGING-108) JPEG EOI marker could not be found at expected location
Date Fri, 12 Jul 2013 21:19:47 GMT

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

Nicolas Desessart commented on IMAGING-108:
-------------------------------------------

The problem is in the TiffReader class in the private method getJpegRawImageData.
{code:title=TiffReader.getJpegRawImageData(ByteSource,TiffDirectory) throws ImageReadException,
IOException|borderStyle=solid}
        // check if the last read byte is actually the end of the image data
        if (length < 2 ||
                (((data[data.length - 2] & 0xff) << 8) | (data[data.length - 1]
& 0xff)) != JpegConstants.EOIMarker) {
            throw new ImageReadException("JPEG EOI marker could not be found at expected location");
        }
{code}
I also had to comment out those lines because some images editors or transfer tools may damage
the OEI marker.
I see no reason to check if the image isn't corrupted instead of doing best effort reading.
Especially in a private method used by core mechanisms, which means no overriding possibility.
This error didn't occur in Sanselan.
This should really be fixed. :)

                
> JPEG EOI marker could not be found at expected location
> -------------------------------------------------------
>
>                 Key: IMAGING-108
>                 URL: https://issues.apache.org/jira/browse/IMAGING-108
>             Project: Commons Imaging
>          Issue Type: Bug
>          Components: Format: JPEG
>         Environment: Windows
>            Reporter: Petr Nejedly
>         Attachments: Christmas 2004 Matt 002.jpg
>
>
> Getting the above exception when calling
> ImageInfo imageInfo = Imaging.getImageInfo(f.getInputStream(), f.getFilename());
> for the attached file.

--
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

Mime
View raw message