diff --git a/libvips/resample/thumbnail.c b/libvips/resample/thumbnail.c index 61830750..0d819be7 100644 --- a/libvips/resample/thumbnail.c +++ b/libvips/resample/thumbnail.c @@ -685,6 +685,10 @@ vips_thumbnail_build( VipsObject *object ) in = t[12]; } + /* Note the interpretation we will revert to after linear. + */ + input_interpretation = in->Type; + /* In linear mode, we need to transform to a linear space before * vips_resize(). */ @@ -719,11 +723,6 @@ vips_thumbnail_build( VipsObject *object ) */ VipsInterpretation interpretation; - /* Note the interpretation we will revert to after - * linear. - */ - input_interpretation = in->Type; - if( in->Bands < 3 ) interpretation = VIPS_INTERPRETATION_GREY16; else