You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2022/12/21 08:23:07 UTC
svn commit: r1906124 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/image/SampledImageReader.java
Author: tilman
Date: Wed Dec 21 08:23:07 2022
New Revision: 1906124
URL: http://svn.apache.org/viewvc?rev=1906124&view=rev
Log:
PDFBOX-5553: indexed 1-bit colorspaces can have a valid /Decode
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=1906124&r1=1906123&r2=1906124&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 Dec 21 08:23:07 2022
@@ -439,7 +439,7 @@ final class SampledImageReader
// and then simply shift bits out to the left, detecting set bits via sign
final boolean nosubsampling = currentSubsampling == 1;
final int stride = (inputWidth + 7) / 8;
- final int invert = colorSpace instanceof PDIndexed || decode[0] < decode[1] ? 0 : -1;
+ final int invert = decode[0] < decode[1] ? 0 : -1;
final int endX = startx + scanWidth;
final byte[] buff = new byte[stride];
for (int y = 0; y < starty + scanHeight; y++)