fix profile removal

we had a possible shared image
This commit is contained in:
John Cupitt 2019-12-20 14:12:25 +00:00
parent 8030d7b926
commit 76dd2d3910
1 changed files with 12 additions and 1 deletions

View File

@ -1596,8 +1596,19 @@ vips__foreign_convert_saveable( VipsImage *in, VipsImage **ready,
if( !vips_image_get_blob( in, VIPS_META_ICC_NAME,
&data, &length ) &&
!vips_icc_is_compatible_profile( in, data, length ) )
!vips_icc_is_compatible_profile( in, data, length ) ) {
VipsImage *out;
if( vips_copy( in, &out, NULL ) ) {
g_object_unref( in );
return( -1 );
}
g_object_unref( in );
in = out;
vips_image_remove( in, VIPS_META_ICC_NAME );
}
}
*ready = in;