Merge branch '8.10' into revise-premultiply

This commit is contained in:
John Cupitt 2021-03-05 11:17:40 +00:00 committed by GitHub
commit 1f18963cb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 6 deletions

View File

@ -9,6 +9,7 @@
- fix a possible segv with very wide images [f1ac]
- revise premultiply, again [jjonesrs]
- revise profile handling in vipsthumbnail
- fix tiff deflate predictor setting [Adios]
18/12/20 started 8.10.5
- fix potential /0 in animated webp load [lovell]

View File

@ -590,8 +590,8 @@ vips_foreign_save_tiff_buffer_init( VipsForeignSaveTiffBuffer *buffer )
* User @level to set the ZSTD compression level. Use @lossless to
* set WEBP lossless mode on. Use @Q to set the WEBP compression level.
*
* Use @predictor to set the predictor for lzw and deflate compression. It
* defaults to #VIPS_FOREIGN_TIFF_PREDICTOR_HORIZONTAL, meaning horizontal
* Use @predictor to set the predictor for lzw, deflate and zstd compression.
* It defaults to #VIPS_FOREIGN_TIFF_PREDICTOR_HORIZONTAL, meaning horizontal
* differencing. Please refer to the libtiff
* specifications for further discussion of various predictors.
*

View File

@ -333,9 +333,9 @@ struct _Wtiff {
VipsPel *tbuf; /* TIFF output buffer */
int tls; /* Tile line size */
int compression; /* Compression type */
int compression; /* libtiff compression type */
int Q; /* JPEG q-factor, webp level */
int predictor; /* Predictor value */
int predictor; /* libtiff predictor type */
int tile; /* Tile or not */
int tilew, tileh; /* Tile size */
int pyramid; /* Wtiff pyramid */
@ -663,8 +663,9 @@ wtiff_write_header( Wtiff *wtiff, Layer *layer )
TIFFSetField( tif, TIFFTAG_ZSTD_LEVEL, wtiff->level );
#endif /*HAVE_TIFF_COMPRESSION_WEBP*/
if( (wtiff->compression == VIPS_FOREIGN_TIFF_COMPRESSION_DEFLATE ||
wtiff->compression == VIPS_FOREIGN_TIFF_COMPRESSION_LZW) &&
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 );
@ -1866,6 +1867,12 @@ wtiff_copy_tiff( Wtiff *wtiff, TIFF *out, TIFF *in )
TIFFSetField( out, TIFFTAG_ZSTD_LEVEL, wtiff->level );
#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 );
/* We can't copy profiles or xmp :( Set again from wtiff.
*/
if( !wtiff->strip )