#394: Fix for ArrayIndexOutOfBoundsException for grayscale floating point TIFFs + bonus WhiteIsZero for float.

This commit is contained in:
Harald Kuhr 2017-11-18 16:16:46 +01:00
parent 7a5110506b
commit 743c2bf3cd

View File

@ -1765,8 +1765,6 @@ public final class TIFFImageReader extends ImageReaderBase {
readFully(input, rowDataFloat);
if (row >= srcRegion.y) {
// TODO: Allow param to decide tone mapping strategy, like in the HDRImageReader
clamp(rowDataFloat);
normalizeColor(interpretation, rowDataFloat);
// Subsample horizontal
@ -2008,6 +2006,9 @@ public final class TIFFImageReader extends ImageReaderBase {
}
private void normalizeColor(int photometricInterpretation, float[] data) {
// TODO: Allow param to decide tone mapping strategy, like in the HDRImageReader
clamp(data);
switch (photometricInterpretation) {
case TIFFBaseline.PHOTOMETRIC_WHITE_IS_ZERO:
// Inverse values