You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by eb...@apache.org on 2013/11/25 14:13:30 UTC

svn commit: r1545252 - /commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkItxt.java

Author: ebourg
Date: Mon Nov 25 13:13:30 2013
New Revision: 1545252

URL: http://svn.apache.org/r1545252
Log:
Removed a redundant test in PngChunkItxt

Modified:
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkItxt.java

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkItxt.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkItxt.java?rev=1545252&r1=1545251&r2=1545252&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkItxt.java (original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/chunks/PngChunkItxt.java Mon Nov 25 13:13:30 2013
@@ -61,16 +61,8 @@ public class PngChunkItxt extends PngTex
         final boolean compressed = compressionFlag == 1;
 
         final int compressionMethod = bytes[index++];
-        if (compressed) {
-            if (compressionMethod != PngConstants.COMPRESSION_DEFLATE_INFLATE) {
-                throw new ImageReadException(
-                        "PNG iTXt chunk has unexpected compression method: "
-                                + compressionMethod);
-            } else if (compressionMethod != 0) {
-                throw new ImageReadException(
-                        "PNG iTXt chunk has unexpected compression method: "
-                                + compressionMethod);
-            }
+        if (compressed && compressionMethod != PngConstants.COMPRESSION_DEFLATE_INFLATE) {
+            throw new ImageReadException("PNG iTXt chunk has unexpected compression method: " + compressionMethod);
         }
 
         terminator = findNull(bytes, index);