You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by da...@apache.org on 2011/12/26 08:18:06 UTC
svn commit: r1224687 - in /commons/proper/sanselan/trunk/src:
main/java/org/apache/commons/sanselan/formats/jpeg/iptc/
test/data/images/jpg/5/
Author: damjan
Date: Mon Dec 26 07:18:06 2011
New Revision: 1224687
URL: http://svn.apache.org/viewvc?rev=1224687&view=rev
Log:
Read in the full IPTC block before trying to ignore it,
so we don't lose our position in the stream.
Also added a test image that shows the problem.
Submitted by: Alex Vigdor <Alex dot Vigdor at abc dot com>
Jira issue key: SANSELAN-35
Added:
commons/proper/sanselan/trunk/src/test/data/images/jpg/5/
commons/proper/sanselan/trunk/src/test/data/images/jpg/5/2010-01-04T052300Z_01_BTRE6021PS000_RTROPTP_3_BUSINESS-US-TSE.JPG (with props)
commons/proper/sanselan/trunk/src/test/data/images/jpg/5/info.txt (with props)
Modified:
commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IptcParser.java
Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IptcParser.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IptcParser.java?rev=1224687&r1=1224686&r2=1224687&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IptcParser.java (original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/jpeg/iptc/IptcParser.java Mon Dec 26 07:18:06 2011
@@ -156,9 +156,6 @@ public class IptcParser extends BinaryFi
Debug.debug("recordNumber", recordNumber + " (0x"
+ Integer.toHexString(recordNumber) + ")");
- if (recordNumber != IPTC_APPLICATION_2_RECORD_NUMBER)
- continue;
-
// int recordPrefix = convertByteArrayToShort("recordPrefix", index,
// bytes);
// if (verbose)
@@ -201,6 +198,9 @@ public class IptcParser extends BinaryFi
// Debug.debug("recordSize", recordSize + " (0x"
// + Integer.toHexString(recordSize) + ")");
+
+ if (recordNumber != IPTC_APPLICATION_2_RECORD_NUMBER)
+ continue;
if (recordType == 0)
{
Added: commons/proper/sanselan/trunk/src/test/data/images/jpg/5/2010-01-04T052300Z_01_BTRE6021PS000_RTROPTP_3_BUSINESS-US-TSE.JPG
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/test/data/images/jpg/5/2010-01-04T052300Z_01_BTRE6021PS000_RTROPTP_3_BUSINESS-US-TSE.JPG?rev=1224687&view=auto
==============================================================================
Binary file - no diff available.
Propchange: commons/proper/sanselan/trunk/src/test/data/images/jpg/5/2010-01-04T052300Z_01_BTRE6021PS000_RTROPTP_3_BUSINESS-US-TSE.JPG
------------------------------------------------------------------------------
svn:mime-type = image/jpeg
Added: commons/proper/sanselan/trunk/src/test/data/images/jpg/5/info.txt
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/test/data/images/jpg/5/info.txt?rev=1224687&view=auto
==============================================================================
--- commons/proper/sanselan/trunk/src/test/data/images/jpg/5/info.txt (added)
+++ commons/proper/sanselan/trunk/src/test/data/images/jpg/5/info.txt Mon Dec 26 07:18:06 2011
@@ -0,0 +1,2 @@
+2010-01-04T052300Z_01_BTRE6021PS000_RTROPTP_3_BUSINESS-US-TSE.JPG
+Submitted by Alex Vigdor on SANSELAN-35. Demonstrates an IPTC parsing bug in Sanselan.
Propchange: commons/proper/sanselan/trunk/src/test/data/images/jpg/5/info.txt
------------------------------------------------------------------------------
svn:eol-style = native