< prev index next >

src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFLZWDecompressor.java

Print this page

        

*** 160,179 **** } } if (predictor == BaselineTIFFTagSet.PREDICTOR_HORIZONTAL_DIFFERENCING) { ! for (int j = 0; j < srcHeight; j++) { ! ! int count = dstOffset + samplesPerPixel * (j * srcWidth + 1); ! for (int i = samplesPerPixel; i < srcWidth * samplesPerPixel; i++) { ! ! dstData[count] += dstData[count - samplesPerPixel]; count++; } } } return dstIndex - dstOffset; } --- 160,181 ---- } } if (predictor == BaselineTIFFTagSet.PREDICTOR_HORIZONTAL_DIFFERENCING) { + int step = planar || samplesPerPixel == 1 ? 1 : samplesPerPixel; ! int samplesPerRow = step * srcWidth; ! int off = dstOffset + step; ! for (int j = 0; j < srcHeight; j++) { ! int count = off; ! for (int i = step; i < samplesPerRow; i++) { ! dstData[count] += dstData[count - step]; count++; } + off += samplesPerRow; } } return dstIndex - dstOffset; }
< prev index next >