From a3d25449349802e4b743775d98f345e3a5e4f32a Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Sat, 31 Aug 2019 12:30:06 +0100 Subject: [PATCH] sharpen restores colourspace --- libvips/convolution/sharpen.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libvips/convolution/sharpen.c b/libvips/convolution/sharpen.c index 214d52ee..795299a6 100644 --- a/libvips/convolution/sharpen.c +++ b/libvips/convolution/sharpen.c @@ -41,6 +41,7 @@ * - move to defaults suitable for screen output * 28/8/19 * - fix sigma 0.5 case (thanks 2h4dl) + * - restore input colourspace */ /* @@ -176,6 +177,7 @@ vips_sharpen_build( VipsObject *object ) VipsImage **args = (VipsImage **) vips_object_local_array( object, 2 ); VipsImage *in; + VipsInterpretation old_interpretation; int i; VIPS_GATE_START( "vips_sharpen_build: build" ); @@ -192,6 +194,7 @@ vips_sharpen_build( VipsObject *object ) in = sharpen->in; + old_interpretation = in->Type; if( vips_colourspace( in, &t[0], VIPS_INTERPRETATION_LABS, NULL ) ) return( -1 ); in = t[0]; @@ -286,7 +289,8 @@ vips_sharpen_build( VipsObject *object ) /* Reattach the rest. */ if( vips_bandjoin2( t[5], t[3], &t[6], NULL ) || - vips_image_write( t[6], sharpen->out ) ) + vips_colourspace( t[6], &t[7], old_interpretation, NULL ) || + vips_image_write( t[7], sharpen->out ) ) return( -1 ); VIPS_GATE_STOP( "vips_sharpen_build: build" );