convert no-profile CMYK to RGB on save

Use the fallback cmyk profile to convert to RGB on save if the image has
no embedded profile.

Thanks augustocdias.

See https://github.com/libvips/libvips/issues/1767
This commit is contained in:
John Cupitt 2020-08-19 11:09:38 +01:00
parent 182e88957e
commit 270933c281
2 changed files with 4 additions and 2 deletions

View File

@ -3,6 +3,7 @@
- remove typedef redefinitions to please old gccs
- fix regression in tiff pyramid thumbnailing [tand826]
- stop 0-length buffer being passed to imagemagick [lovell]
- convert no-profile CMYK to RGB on save [augustocdias]
24/1/20 started 8.10.0
- more conformat IIIF output from dzsave [regisrob]

View File

@ -1336,8 +1336,7 @@ vips__foreign_convert_saveable( VipsImage *in, VipsImage **ready,
}
/* If this image is CMYK and the saver is RGB-only, use lcms to try to
* import to XYZ. This will only work if the image has an embedded
* profile.
* import to XYZ.
*/
if( in->Type == VIPS_INTERPRETATION_CMYK &&
in->Bands >= 4 &&
@ -1348,6 +1347,8 @@ vips__foreign_convert_saveable( VipsImage *in, VipsImage **ready,
if( vips_icc_import( in, &out,
"pcs", VIPS_PCS_XYZ,
"embedded", TRUE,
"input_profile", "cmyk",
NULL ) ) {
g_object_unref( in );
return( -1 );