TIFFTAG_PREDICTOR is not supported for WebP

fixes #158
https://gitlab.com/libtiff/libtiff/-/issues/158

this bug was introduced by 9eacd59fec
merge request !32
This commit is contained in:
Thomas Bernard 2020-03-08 18:21:56 +01:00
parent e95584d3b8
commit 54ce8c5220
No known key found for this signature in database
GPG Key ID: 0FF11B67A5C0863C
2 changed files with 2 additions and 5 deletions

View File

@ -1236,10 +1236,6 @@ _TIFFCheckFieldIsValidForCodec(TIFF *tif, ttag_t tag)
if (tag == TIFFTAG_LERC_PARAMETERS) if (tag == TIFFTAG_LERC_PARAMETERS)
return 1; return 1;
break; break;
case COMPRESSION_WEBP:
if (tag == TIFFTAG_PREDICTOR)
return 1;
break;
} }
return 0; return 0;
} }

View File

@ -741,11 +741,12 @@ tiffcp(TIFF* in, TIFF* out)
case COMPRESSION_DEFLATE: case COMPRESSION_DEFLATE:
case COMPRESSION_LZMA: case COMPRESSION_LZMA:
case COMPRESSION_ZSTD: case COMPRESSION_ZSTD:
case COMPRESSION_WEBP:
if (predictor != (uint16)-1) if (predictor != (uint16)-1)
TIFFSetField(out, TIFFTAG_PREDICTOR, predictor); TIFFSetField(out, TIFFTAG_PREDICTOR, predictor);
else else
CopyField(TIFFTAG_PREDICTOR, predictor); CopyField(TIFFTAG_PREDICTOR, predictor);
/*fallthrough*/
case COMPRESSION_WEBP:
if (preset != -1) { if (preset != -1) {
if (compression == COMPRESSION_ADOBE_DEFLATE if (compression == COMPRESSION_ADOBE_DEFLATE
|| compression == COMPRESSION_DEFLATE) || compression == COMPRESSION_DEFLATE)