2
0
mirror of https://github.com/boostorg/gil.git synced 2026-02-19 02:22:09 +00:00

GIL: a further fix on the PNG IO 16-bit bug

[SVN r38868]
This commit is contained in:
Hailin Jin
2007-08-23 19:26:55 +00:00
parent fd70ef69e7
commit 1e92d4580e

View File

@@ -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<typename channel_type<View>::type,
typename color_space_type<View>::type>::bit_depth>8)
png_set_swap(_png_ptr);
std::vector<pixel<typename channel_type<View>::type,
layout<typename color_space_type<View>::type> > > row(view.width());