From 495b54dfcfc2ce3aeead23603b691df841af0902 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Thu, 4 Mar 2021 17:31:08 +0000 Subject: [PATCH] grou predictor settings --- libvips/foreign/vips2tiff.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/libvips/foreign/vips2tiff.c b/libvips/foreign/vips2tiff.c index 05103a4e..6c8d6d71 100644 --- a/libvips/foreign/vips2tiff.c +++ b/libvips/foreign/vips2tiff.c @@ -659,16 +659,12 @@ wtiff_write_header( Wtiff *wtiff, Layer *layer ) TIFFSetField( tif, TIFFTAG_WEBP_LEVEL, wtiff->Q ); TIFFSetField( tif, TIFFTAG_WEBP_LOSSLESS, wtiff->lossless ); } - if( wtiff->compression == COMPRESSION_ZSTD ) { + if( wtiff->compression == COMPRESSION_ZSTD ) TIFFSetField( tif, TIFFTAG_ZSTD_LEVEL, wtiff->level ); - - if( wtiff->predictor != VIPS_FOREIGN_TIFF_PREDICTOR_NONE ) - TIFFSetField( tif, TIFFTAG_PREDICTOR, - wtiff->predictor ); - } #endif /*HAVE_TIFF_COMPRESSION_WEBP*/ if( (wtiff->compression == COMPRESSION_ADOBE_DEFLATE || + wtiff->compression == COMPRESSION_ZSTD || wtiff->compression == COMPRESSION_LZW) && wtiff->predictor != VIPS_FOREIGN_TIFF_PREDICTOR_NONE ) TIFFSetField( tif, TIFFTAG_PREDICTOR, wtiff->predictor ); @@ -1867,16 +1863,12 @@ wtiff_copy_tiff( Wtiff *wtiff, TIFF *out, TIFF *in ) TIFFSetField( out, TIFFTAG_WEBP_LEVEL, wtiff->Q ); TIFFSetField( out, TIFFTAG_WEBP_LOSSLESS, wtiff->lossless ); } - if( wtiff->compression == COMPRESSION_ZSTD ) { + if( wtiff->compression == COMPRESSION_ZSTD ) TIFFSetField( out, TIFFTAG_ZSTD_LEVEL, wtiff->level ); - - if( wtiff->predictor != VIPS_FOREIGN_TIFF_PREDICTOR_NONE ) - TIFFSetField( out, TIFFTAG_PREDICTOR, - wtiff->predictor ); - } #endif /*HAVE_TIFF_COMPRESSION_WEBP*/ if( (wtiff->compression == COMPRESSION_ADOBE_DEFLATE || + wtiff->compression == COMPRESSION_ZSTD || wtiff->compression == COMPRESSION_LZW) && wtiff->predictor != VIPS_FOREIGN_TIFF_PREDICTOR_NONE ) TIFFSetField( out, TIFFTAG_PREDICTOR, wtiff->predictor );