diff -ruBbiw gil/boost/gil/extension/io/png_io_private.hpp boost/boost/include/boost-1_34/boost/gil/extension/io/png_io_private.hpp
old
|
new
|
|
20 | 20 | |
21 | 21 | #include <algorithm> |
22 | 22 | #include <vector> |
| 23 | #include <boost/detail/endian.hpp> |
23 | 24 | #include <boost/static_assert.hpp> |
24 | 25 | #include "../../gil_all.hpp" |
25 | 26 | #include "io_error.hpp" |
… |
… |
|
162 | 163 | png_init_io(_png_ptr, get()); |
163 | 164 | png_set_sig_bytes(_png_ptr,PNG_BYTES_TO_CHECK); |
164 | 165 | png_read_info(_png_ptr, _info_ptr); |
| 166 | #ifdef BOOST_LITTLE_ENDIAN |
| 167 | if (16 == png_get_bit_depth (_png_ptr, _info_ptr)) |
| 168 | png_set_swap (_png_ptr); |
| 169 | #endif |
165 | 170 | } |
166 | 171 | public: |
167 | 172 | png_reader(FILE* file ) : file_mgr(file) { init(); } |
… |
… |
|
337 | 342 | PNG_INTERLACE_NONE, |
338 | 343 | PNG_COMPRESSION_TYPE_DEFAULT,PNG_FILTER_TYPE_DEFAULT); |
339 | 344 | png_write_info(_png_ptr,_info_ptr); |
| 345 | #ifdef BOOST_LITTLE_ENDIAN |
| 346 | if (16 == png_write_support_private<typename channel_type<View>::type |
| 347 | , typename color_space_type<View>::type>::bit_depth) |
| 348 | png_set_swap(_png_ptr); |
| 349 | #endif |
340 | 350 | std::vector<pixel<typename channel_type<View>::type, |
341 | 351 | layout<typename color_space_type<View>::type> > > row(view.width()); |
342 | 352 | for(int y=0;y<view.height();++y) { |