From 1e92d4580e1aeda64804e9c614ed13038d2b65d5 Mon Sep 17 00:00:00 2001 From: Hailin Jin Date: Thu, 23 Aug 2007 19:26:55 +0000 Subject: [PATCH] GIL: a further fix on the PNG IO 16-bit bug [SVN r38868] --- include/boost/gil/extension/io/png_io_private.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/boost/gil/extension/io/png_io_private.hpp b/include/boost/gil/extension/io/png_io_private.hpp index 8034784f1..2840f1c33 100644 --- a/include/boost/gil/extension/io/png_io_private.hpp +++ b/include/boost/gil/extension/io/png_io_private.hpp @@ -339,7 +339,9 @@ public: PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT,PNG_FILTER_TYPE_DEFAULT); png_write_info(_png_ptr,_info_ptr); - if (little_endian() && png_get_bit_depth(_png_ptr,_info_ptr)>8) + if (little_endian() && + png_write_support_private::type, + typename color_space_type::type>::bit_depth>8) png_set_swap(_png_ptr); std::vector::type, layout::type> > > row(view.width());