block use of RGB profiles with CMYK images
Detect and block a common error. See https://github.com/libvips/libvips/issues/3139
This commit is contained in:
parent
17ca29adc9
commit
3d29daf553
|
@ -589,6 +589,16 @@ vips_icc_load_profile_blob( VipsBlob *blob,
|
|||
return( NULL );
|
||||
}
|
||||
|
||||
/* Spot the common error of an RGB profile and a CMYK image.
|
||||
*/
|
||||
if( image &&
|
||||
image->Type == VIPS_INTERPRETATION_CMYK &&
|
||||
info->bands == 3 ) {
|
||||
VIPS_FREEF( cmsCloseProfile, profile );
|
||||
g_warning( "%s", _( "profile incompatible with image" ) );
|
||||
return( NULL );
|
||||
}
|
||||
|
||||
if( !cmsIsIntentSupported( profile, intent, direction ) ) {
|
||||
VIPS_FREEF( cmsCloseProfile, profile );
|
||||
g_warning( _( "profile does not support %s %s intent" ),
|
||||
|
|
Loading…
Reference in New Issue