strip ICC profile on conversion in xyz2srgb

if we use the vips xys->srgb  path (ie. not the lcms one) we must remove
any ICC profile left over from import, otherwise we may have srgb pixels
with a non-srgb profile
This commit is contained in:
John Cupitt 2013-07-01 09:23:09 +01:00
parent a818c64f09
commit 3b6bcef700
2 changed files with 19 additions and 0 deletions

View File

@ -1,5 +1,6 @@
28/6/13 started 7.34.1
- fix morphological operators on non-uchar images
- remove any ICC profile when we use vips to go to srgb
7/6/13 started 7.34.0
- version bump

View File

@ -2,6 +2,8 @@
*
* 11/12/12
* - from Yxy2XYZ.c
* 1/7/13
* - remove any ICC profile
*/
/*
@ -48,6 +50,21 @@ typedef VipsColourSpaceClass VipsXYZ2scRGBClass;
G_DEFINE_TYPE( VipsXYZ2scRGB, vips_XYZ2scRGB, VIPS_TYPE_COLOUR_SPACE );
static int
vips_XYZ2scRGB_build( VipsObject *object )
{
if( VIPS_OBJECT_CLASS( vips_XYZ2scRGB_parent_class )->build( object ) )
return( -1 );
/* We've converted to sRGB without a profile. We must remove any ICC
* profile left over from import or there will be a mismatch between
* pixel values and the attached profile.
*/
vips_image_remove( VIPS_COLOUR( object )->out, VIPS_META_ICC_NAME );
return( 0 );
}
void
vips_XYZ2scRGB_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width )
{
@ -83,6 +100,7 @@ vips_XYZ2scRGB_class_init( VipsXYZ2scRGBClass *class )
object_class->nickname = "XYZ2scRGB";
object_class->description = _( "transform XYZ to scRGB" );
object_class->build = vips_XYZ2scRGB_build;
colour_class->process_line = vips_XYZ2scRGB_line;
}