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

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

No problem [~lwollerman] , you reported the issue with example code and an 
attachment to reproduce it, and with a good issue description. I've just 
updated the formatting to use the code and the noformat macros (I type the 
macros, but there are some buttons in the editor that can help too).

Will try to reproduce and debug the issue later. Thanks!!!

> Invalid Block Size error prevents handling of block 1084, Macintosh 
> NSPrintInfo
> -------------------------------------------------------------------------------
>
>                 Key: IMAGING-246
>                 URL: https://issues.apache.org/jira/browse/IMAGING-246
>             Project: Commons Imaging
>          Issue Type: Bug
>          Components: Format: JPEG
>    Affects Versions: 1.0-alpha1
>            Reporter: Liberty Wollerman
>            Priority: Major
>         Attachments: FallHarvestKitKat_07610.jpg
>
>
> When processing an image created on a Mac with Adobe Photoshop which contains 
> embedded metadata having block 1084, an invalid block size error occurs.
> |0x043C|1084|_(Photoshop CS5)_ Macintosh NSPrintInfo. Variable OS specific 
> info for Macintosh. NSPrintInfo. It is recommened that you do not interpret 
> or use this data.|
>  
> Here is some simple test code that replicates what our application is trying 
> to do, and recreates the error:
> {code:java}
> import java.util.regex.Matcher;
> import java.util.regex.Pattern;
> public class RegexMatches {
>     public static void main(String args[]) {        // String to be scanned 
> to find the pattern.
>         String line = "This order was placed for QT3000! OK?";
>         String pattern = "(.*)(\\d+)(.*)";        // Create a Pattern object
>         Pattern r = Pattern.compile(pattern);        // Now create matcher 
> object.
>         Matcher m = r.matcher(line);
>         if (m.find()) {
>             System.out.println("Found value: " + m.group(0));
>             System.out.println("Found value: " + m.group(1));
>             System.out.println("Found value: " + m.group(2));
>         } else {
>             System.out.println("NO MATCH");
>         }
>     }
> }{code}
>  
> Here is the resulting error:
> {noformat}
>  Exception in thread "main" org.apache.commons.imaging.ImageReadException: 
> Invalid Block Size : 89562 > 65504Exception in thread "main" 
>  org.apache.commons.imaging.ImageReadException: Invalid Block Size : 89562 > 
> 65504 at 
>  
> org.apache.commons.imaging.formats.jpeg.iptc.IptcParser.parseAllBlocks(IptcParser.java:318)
>  at 
>  
> org.apache.commons.imaging.formats.jpeg.iptc.IptcParser.parsePhotoshopSegment(IptcParser.java:119)
>  at 
>  
> org.apache.commons.imaging.formats.jpeg.iptc.IptcParser.parsePhotoshopSegment(IptcParser.java:112)
>  at 
>  
> org.apache.commons.imaging.formats.jpeg.segments.App13Segment.parsePhotoshopSegment(App13Segment.java:71)
>  at 
>  
> org.apache.commons.imaging.formats.jpeg.JpegImageParser.getPhotoshopMetadata(JpegImageParser.java:599)
>  at 
>  
> org.apache.commons.imaging.formats.jpeg.JpegImageParser.getMetadata(JpegImageParser.java:318)
>  at 
>  
> org.apache.commons.imaging.formats.jpeg.JpegImageParser.getImageInfo(JpegImageParser.java:739)
>  at org.apache.commons.imaging.Imaging.getImageInfo(Imaging.java:701) at 
>  org.apache.commons.imaging.Imaging.getImageInfo(Imaging.java:635) at 
> Main.getMetaData(Main.java:22) at Main.main(Main.java:17){noformat}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to