From bdb9cf4d476a3d11956dc058ee114f0dd0718406 Mon Sep 17 00:00:00 2001 From: thierry Date: Mon, 18 Jan 2016 17:56:26 +0100 Subject: [PATCH] fix inversed grayscale conditional --- modules/imgcodecs/src/grfmt_png.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/imgcodecs/src/grfmt_png.cpp b/modules/imgcodecs/src/grfmt_png.cpp index e75f0bf45f..5b33c66484 100644 --- a/modules/imgcodecs/src/grfmt_png.cpp +++ b/modules/imgcodecs/src/grfmt_png.cpp @@ -266,7 +266,7 @@ bool PngDecoder::readData( Mat& img ) if( m_color_type == PNG_COLOR_TYPE_PALETTE ) png_set_palette_to_rgb( png_ptr ); - if( (m_color_type & PNG_COLOR_MASK_COLOR) != 0 && m_bit_depth < 8 ) + if( (m_color_type & PNG_COLOR_MASK_COLOR) == 0 && m_bit_depth < 8 ) #if (PNG_LIBPNG_VER_MAJOR*10000 + PNG_LIBPNG_VER_MINOR*100 + PNG_LIBPNG_VER_RELEASE >= 10209) || \ (PNG_LIBPNG_VER_MAJOR == 1 && PNG_LIBPNG_VER_MINOR == 0 && PNG_LIBPNG_VER_RELEASE >= 18) png_set_expand_gray_1_2_4_to_8( png_ptr );