commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Neidhart (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (IMAGING-104) ByteSourceInputStream not starting at byte 0
Date Sun, 23 Jun 2013 21:09:19 GMT

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

Thomas Neidhart commented on IMAGING-104:
-----------------------------------------

I have tested it with the latest trunk (1.0-SNAPSHOT) and I can not reproduce your problem.
Can you confirm that it has been solved or otherwise attach the jpg image that fails the above
test?
                
> ByteSourceInputStream not starting at byte 0
> --------------------------------------------
>
>                 Key: IMAGING-104
>                 URL: https://issues.apache.org/jira/browse/IMAGING-104
>             Project: Commons Imaging
>          Issue Type: Bug
>          Components: Format: JPEG
>    Affects Versions: 0.97
>            Reporter: Marc Campforts
>
> Following code results in a  
> org.apache.sanselan.ImageReadException: Not a Valid JPEG File: doesn't begin with 0xffd8
> File file = new File(image.jpg);
> InputStream is = new FileInputStream(file);
> JpegImageParser parser = new JpegImageParser();
> ByteSource byteSource = new ByteSourceInputStream(is, "image.jpg");
> ArrayList<?> segments = parser.readSegments(byteSource, new int[] {0xffee}, true);
> But when I use the File instead of the InputStream:
> File file = new File(image.jpg);
> JpegImageParser parser = new JpegImageParser();
> ByteSource byteSource = new ByteSourceFile(file);
> ArrayList<?> segments = parser.readSegments(byteSource, new int[] {0xffee}, true);
> it works.
> When I look into the exception, the process starts to read from byte 1024 instead of
byte 0 when checking the filetype.

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