From d75670592975485895b0950b9a5011360e6ba5e4 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Mon, 2 Jul 2018 08:32:14 +0100 Subject: [PATCH] set EXTRASAMPLES on tiff pyr layers we were not copying EXTRASAMPLES when copying pyr layers --- libvips/foreign/vips2tiff.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libvips/foreign/vips2tiff.c b/libvips/foreign/vips2tiff.c index 08aaa667..14e39ea2 100644 --- a/libvips/foreign/vips2tiff.c +++ b/libvips/foreign/vips2tiff.c @@ -176,6 +176,8 @@ * 24/10/17 * - no error on page-height not a factor of image height, just don't * write multipage + * 2/7/18 + * - copy EXTRASAMPLES to pyramid layers */ /* @@ -1566,6 +1568,7 @@ wtiff_copy_tiff( Wtiff *wtiff, TIFF *out, TIFF *in ) tdata_t buf; ttile_t tile; ttile_t n; + uint16 *a; /* All the fields we might have set. */ @@ -1586,8 +1589,8 @@ wtiff_copy_tiff( Wtiff *wtiff, TIFF *out, TIFF *in ) CopyField( TIFFTAG_ROWSPERSTRIP, i32 ); CopyField( TIFFTAG_SUBFILETYPE, i32 ); - if( wtiff->predictor != VIPS_FOREIGN_TIFF_PREDICTOR_NONE ) - TIFFSetField( out, TIFFTAG_PREDICTOR, wtiff->predictor ); + if( TIFFGetField( in, TIFFTAG_EXTRASAMPLES, &i16, &a ) ) + TIFFSetField( out, TIFFTAG_EXTRASAMPLES, i16, a ); /* TIFFTAG_JPEGQUALITY is a pesudo-tag, so we can't copy it. * Set explicitly from Wtiff.