commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dam...@apache.org
Subject svn commit: r1325834 - /commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/datareaders/DataReaderStrips.java
Date Fri, 13 Apr 2012 16:39:37 GMT
Author: damjan
Date: Fri Apr 13 16:39:37 2012
New Revision: 1325834

URL: http://svn.apache.org/viewvc?rev=1325834&view=rev
Log:
Correct the expected size of the decompressed TIFF image data.

Jira issue key: SANSELAN-72


Modified:
    commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/datareaders/DataReaderStrips.java

Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/datareaders/DataReaderStrips.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/datareaders/DataReaderStrips.java?rev=1325834&r1=1325833&r2=1325834&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/datareaders/DataReaderStrips.java
(original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/datareaders/DataReaderStrips.java
Fri Apr 13 16:39:37 2012
@@ -95,8 +95,9 @@ public final class DataReaderStrips exte
             long rowsPerStripLong = 0xFFFFffffL & rowsPerStrip;
             long rowsRemaining = height - (strip * rowsPerStripLong);
             long rowsInThisStrip = Math.min(rowsRemaining, rowsPerStripLong);
+            long bytesPerRow = (bitsPerPixel * width + 7) / 8;
+            long bytesPerStrip = rowsInThisStrip * bytesPerRow;
             long pixelsPerStrip = rowsInThisStrip * width;
-            long bytesPerStrip = ((pixelsPerStrip * bitsPerPixel) + 7) / 8;
 
             byte compressed[] = imageData.strips[strip].data;
 
@@ -108,4 +109,4 @@ public final class DataReaderStrips exte
         }
     }
 
-}
\ No newline at end of file
+}



Mime
View raw message