From 24a51098b178b67eb8051d04cb1cdcfa365d8af8 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Thu, 12 May 2016 14:54:28 +0100 Subject: [PATCH] compiler warning --- TODO | 2 -- libvips/iofuncs/header.c | 15 ++++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/TODO b/TODO index d8dfc955..cd1ab676 100644 --- a/TODO +++ b/TODO @@ -3,8 +3,6 @@ $ vips copy k2.jpg x.dz[suffix=.jpg[Q=90]] dzsave: not , or ) after parameter -- add n_pages to pdfload - - add more webp tests to py suite - the gif tests in the suite sometimes fail with giflib5 because of an diff --git a/libvips/iofuncs/header.c b/libvips/iofuncs/header.c index 5e913759..61d5b177 100644 --- a/libvips/iofuncs/header.c +++ b/libvips/iofuncs/header.c @@ -433,10 +433,10 @@ vips_image_guess_format( const VipsImage *image ) break; case VIPS_INTERPRETATION_CMYK: - if( image->BandFmt != VIPS_FORMAT_USHORT ) - format = VIPS_FORMAT_UCHAR; + if( image->BandFmt == VIPS_FORMAT_USHORT ) + format = VIPS_FORMAT_USHORT; else - format = image->BandFmt; + format = VIPS_FORMAT_UCHAR; break; case VIPS_INTERPRETATION_LABQ: @@ -453,14 +453,15 @@ vips_image_guess_format( const VipsImage *image ) break; case VIPS_INTERPRETATION_MATRIX: - if( image->BandFmt != VIPS_FORMAT_DOUBLE ) - format = VIPS_FORMAT_FLOAT; + if( image->BandFmt == VIPS_FORMAT_DOUBLE ) + format = VIPS_FORMAT_DOUBLE; else - format = image->BandFmt; + format = VIPS_FORMAT_FLOAT; break; default: - g_assert_not_reached(); + format = VIPS_FORMAT_NOTSET; + break; } return( format );