From 270933c281671ff725ff5e9e153c7a0ae611cc25 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 19 Aug 2020 11:09:38 +0100 Subject: [PATCH] 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 --- ChangeLog | 1 + libvips/foreign/foreign.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index eea4cfff..5bffe2bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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] diff --git a/libvips/foreign/foreign.c b/libvips/foreign/foreign.c index 0459c47f..37e92768 100644 --- a/libvips/foreign/foreign.c +++ b/libvips/foreign/foreign.c @@ -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 );