kinow commented on a change in pull request #68: [IMAGING-246] Skip Photoshop 
IPTC blocks that are not recommended to be interpreted by parsers in the 
specification
URL: https://github.com/apache/commons-imaging/pull/68#discussion_r365546675
 
 

 ##########
 File path: 
src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageParser.java
 ##########
 @@ -598,12 +598,12 @@ public JpegPhotoshopMetadata getPhotoshopMetadata(final 
ByteSource byteSource,
             final App13Segment segment = (App13Segment) s;
 
             final PhotoshopApp13Data data = 
segment.parsePhotoshopSegment(params);
-            if (data != null && photoshopApp13Data != null) {
-                throw new ImageReadException(
-                        "Jpeg contains more than one Photoshop App13 
segment.");
+            if (data != null) {
+                if (photoshopApp13Data != null) {
+                    throw new ImageReadException("Jpeg contains more than one 
Photoshop App13 segment.");
+                }
+                photoshopApp13Data = data;
 
 Review comment:
   The logic removed had an issue, where if the first data was not null, then 
the second was null; the second value would be used. Resulting in missing 
photoshop APP13 data.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to