Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 55E4C9FDA for ; Mon, 26 Dec 2011 07:18:31 +0000 (UTC) Received: (qmail 18063 invoked by uid 500); 26 Dec 2011 07:18:30 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 17874 invoked by uid 500); 26 Dec 2011 07:18:30 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 17867 invoked by uid 99); 26 Dec 2011 07:18:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Dec 2011 07:18:28 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Dec 2011 07:18:27 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id A5C0823888D2 for ; Mon, 26 Dec 2011 07:18:06 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1224687 - in /commons/proper/sanselan/trunk/src: main/java/org/apache/commons/sanselan/formats/jpeg/iptc/ test/data/images/jpg/5/ Date: Mon, 26 Dec 2011 07:18:06 -0000 To: commits@commons.apache.org From: damjan@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111226071806.A5C0823888D2@eris.apache.org> 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 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