From 9069b2f9ad63852c38f5fea07423e3b44b6b9290 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 8 Oct 2014 12:31:36 +0100 Subject: [PATCH] improve interpretation of maplut output a mono image though a colour lut needs to take the lut's interpretation --- ChangeLog | 3 ++- libvips/histogram/maplut.c | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9246a308..d2ca0c82 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ -8/10/14 started 7.40.10 +8/10/14 started 7.40.11 - rework extra band handling for colour functions +- set interpretation of matlut output more carefully 8/9/14 started 7.40.10 - icc_import and icc_transform checks the input profile for compatibility diff --git a/libvips/histogram/maplut.c b/libvips/histogram/maplut.c index 21aa9638..e11c5dfa 100644 --- a/libvips/histogram/maplut.c +++ b/libvips/histogram/maplut.c @@ -602,6 +602,13 @@ vips_maplut_build( VipsObject *object ) if( lut->Bands != 1 ) maplut->out->Bands = lut->Bands; + /* The Type comes from the image with many bands. A B_W index image, + * for example, needs to become an RGB image when it goes through a + * three-band LUT. + */ + if( lut->Bands != 1 ) + maplut->out->Type = lut->Type; + g_signal_connect( in, "preeval", G_CALLBACK( vips_maplut_preeval ), maplut ); g_signal_connect( in, "posteval",