commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dam...@apache.org
Subject svn commit: r1441878 - in /commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats: jpeg/iptc/IptcParser.java tiff/TiffDirectory.java
Date Sun, 03 Feb 2013 09:41:58 GMT
Author: damjan
Date: Sun Feb  3 09:41:57 2013
New Revision: 1441878

URL: http://svn.apache.org/viewvc?rev=1441878&view=rev
Log:
Bugfixes to previous commit.


Modified:
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcParser.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffDirectory.java

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcParser.java?rev=1441878&r1=1441877&r2=1441878&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcParser.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcParser.java
Sun Feb  3 09:41:57 2013
@@ -51,7 +51,7 @@ public class IptcParser extends BinaryFi
 
         final int index = PHOTOSHOP_IDENTIFICATION_STRING.size();
         return (index + 4) <= segmentData.length &&
-                ByteConversions.toInt(segmentData, APP13_BYTE_ORDER) == CONST_8BIM;
+                ByteConversions.toInt(segmentData, index, APP13_BYTE_ORDER) == CONST_8BIM;
     }
 
     /*
@@ -276,8 +276,13 @@ public class IptcParser extends BinaryFi
             // int index = PHOTOSHOP_IDENTIFICATION_STRING.length;
     
             while (true) {
-                final int imageResourceBlockSignature = bis.read4Bytes(
-                        "App13 Segment missing identification string");
+                final int imageResourceBlockSignature;
+                try {
+                    imageResourceBlockSignature = bis.read4Bytes(
+                            "Image Resource Block missing identification string");
+                } catch (IOException ioEx) {
+                    break;
+                }
                 if (imageResourceBlockSignature != CONST_8BIM) {
                     throw new ImageReadException(
                             "Invalid Image Resource Block Signature");

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffDirectory.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffDirectory.java?rev=1441878&r1=1441877&r2=1441878&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffDirectory.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/TiffDirectory.java
Sun Feb  3 09:41:57 2013
@@ -42,9 +42,7 @@ import org.apache.commons.imaging.format
 import org.apache.commons.imaging.formats.tiff.taginfos.TagInfoShort;
 import org.apache.commons.imaging.formats.tiff.taginfos.TagInfoXpString;
 
-public class TiffDirectory extends TiffElement implements TiffConstants
-// extends BinaryFileFunctions
-{
+public class TiffDirectory extends TiffElement implements TiffConstants {
 
     public String description() {
         return TiffDirectory.description(type);



Mime
View raw message