pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1855438 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/SampledImageReader.java
Date Wed, 13 Mar 2019 17:27:45 GMT
Author: tilman
Date: Wed Mar 13 17:27:44 2019
New Revision: 1855438

URL: http://svn.apache.org/viewvc?rev=1855438&view=rev
Log:
PDFBOX-4484: options.isFilterSubsampled() must be called AFTER PDImage.createInputStream(options)

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/SampledImageReader.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/SampledImageReader.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/SampledImageReader.java?rev=1855438&r1=1855437&r2=1855438&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/SampledImageReader.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/SampledImageReader.java
Wed Mar 13 17:27:44 2019
@@ -243,6 +243,9 @@ final class SampledImageReader
         InputStream iis = null;
         try
         {
+            // create stream
+            iis = pdImage.createInputStream(options);
+
             final int inputWidth;
             final int startx;
             final int starty;
@@ -282,9 +285,6 @@ final class SampledImageReader
             output = ((DataBufferByte) raster.getDataBuffer()).getData();
             final boolean isIndexed = colorSpace instanceof PDIndexed;
 
-            // create stream
-            iis = pdImage.createInputStream(options);
-
             int rowLen = inputWidth / 8;
             if (inputWidth % 8 > 0)
             {
@@ -464,6 +464,8 @@ final class SampledImageReader
         ImageInputStream iis = null;
         try
         {
+            iis = new MemoryCacheImageInputStream(pdImage.createInputStream(options));
+
             final int inputWidth;
             final int startx;
             final int starty;
@@ -490,7 +492,6 @@ final class SampledImageReader
             }
             // create stream
             final float sampleMax = (float) Math.pow(2, bitsPerComponent) - 1f;
-            iis = new MemoryCacheImageInputStream(pdImage.createInputStream(options));
             final boolean isIndexed = colorSpace instanceof PDIndexed;
 
             // init color key mask



Mime
View raw message