disable chroma subsample in jpeg-tiff if Q>=90

see https://github.com/jcupitt/libvips/issues/218
This commit is contained in:
John Cupitt 2015-01-19 22:01:13 +00:00
parent c805b382fe
commit dbd98ba86c
2 changed files with 9 additions and 3 deletions

View File

@ -9,6 +9,7 @@
- renamed VIPS_FOREIGN_DZ_DEPTH_1 as VIPS_FOREIGN_DZ_DEPTH_ONE etc. to help - renamed VIPS_FOREIGN_DZ_DEPTH_1 as VIPS_FOREIGN_DZ_DEPTH_ONE etc. to help
bindings bindings
- vipsthumbnail will return an error code if one or more conversions failed - vipsthumbnail will return an error code if one or more conversions failed
- disable chroma subsample in jpeg-tiff if Q >= 90
24/12/14 started 7.42.1 24/12/14 started 7.42.1
- add gobject-2.0 to Requires: in vips and vips-cpp .pc files - add gobject-2.0 to Requires: in vips and vips-cpp .pc files

View File

@ -144,6 +144,8 @@
* - embed XMP in output * - embed XMP in output
* 10/12/14 * 10/12/14
* - zero out edge tile buffers before jpeg write, thanks iwbh15 * - zero out edge tile buffers before jpeg write, thanks iwbh15
* 19/1/15
* - disable chroma subsample if Q >= 90
*/ */
/* /*
@ -575,7 +577,7 @@ write_tiff_header( TiffWrite *tw, TIFF *tif, int width, int height )
else if( tw->compression == COMPRESSION_JPEG && else if( tw->compression == COMPRESSION_JPEG &&
tw->im->Bands == 3 && tw->im->Bands == 3 &&
tw->im->BandFmt == VIPS_FORMAT_UCHAR && tw->im->BandFmt == VIPS_FORMAT_UCHAR &&
!tw->rgbjpeg ) { (!tw->rgbjpeg && tw->jpqual < 90) ) {
/* This signals to libjpeg that it can do /* This signals to libjpeg that it can do
* YCbCr chrominance subsampling from RGB, not * YCbCr chrominance subsampling from RGB, not
* that we will supply the image as YCbCr. * that we will supply the image as YCbCr.
@ -1493,8 +1495,11 @@ tiff_copy( TiffWrite *tw, TIFF *out, TIFF *in )
tw->im->BandFmt == VIPS_FORMAT_UCHAR ) { tw->im->BandFmt == VIPS_FORMAT_UCHAR ) {
/* Enable rgb->ycbcr conversion in the jpeg write. /* Enable rgb->ycbcr conversion in the jpeg write.
*/ */
TIFFSetField( out, if( !tw->rgbjpeg &&
TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RGB ); tw->jpqual >= 90 )
TIFFSetField( out,
TIFFTAG_JPEGCOLORMODE,
JPEGCOLORMODE_RGB );
/* And we want ycbcr expanded to rgb on read. Otherwise /* And we want ycbcr expanded to rgb on read. Otherwise
* TIFFTileSize() will give us the size of a chrominance * TIFFTileSize() will give us the size of a chrominance