Fix black channel overwrite in XZY2CMYK.c
This commit is contained in:
parent
8ded32ac20
commit
5f61727253
@ -151,8 +151,6 @@ vips_XYZ2CMYK_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width )
|
||||
float g = p[1] / VIPS_D65_Y0;
|
||||
float b = p[2] / VIPS_D65_Z0;
|
||||
|
||||
if (r < epsilon && g < epsilon && b < epsilon)
|
||||
q[3] = 255.0;
|
||||
c = 255.0 - r;
|
||||
m = 255.0 - g;
|
||||
y = 255.0 - b;
|
||||
@ -166,7 +164,10 @@ vips_XYZ2CMYK_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width )
|
||||
q[0] = (unsigned char) VIPS_CLIP(0, c, 255.0);
|
||||
q[1] = (unsigned char) VIPS_CLIP(0, m, 255.0);
|
||||
q[2] = (unsigned char) VIPS_CLIP(0, y, 255.0);
|
||||
q[3] = (unsigned char) VIPS_CLIP(0, k, 255.0);
|
||||
if (r < epsilon && g < epsilon && b < epsilon)
|
||||
q[3] = 255.0;
|
||||
else
|
||||
q[3] = (unsigned char) VIPS_CLIP(0, k, 255.0);
|
||||
|
||||
p += 3;
|
||||
q += 4;
|
||||
|
@ -750,8 +750,8 @@ vips_colour_operation_init( void )
|
||||
extern GType vips_HSV2sRGB_get_type( void );
|
||||
extern GType vips_scRGB2XYZ_get_type( void );
|
||||
extern GType vips_scRGB2BW_get_type( void );
|
||||
extern GType vips_XYZ2scRGB_get_type( void );
|
||||
extern GType vips_scRGB2sRGB_get_type( void );
|
||||
extern GType vips_XYZ2scRGB_get_type( void );
|
||||
extern GType vips_scRGB2sRGB_get_type( void );
|
||||
extern GType vips_CMYK2XYZ_get_type( void );
|
||||
extern GType vips_XYZ2CMYK_get_type( void );
|
||||
extern GType vips_profile_load_get_type( void );
|
||||
|
Loading…
Reference in New Issue
Block a user