以下代码发出警告:
boost::gil::rgb8_image_t img(10, 10);
boost::gil::png_write_view("TenByTen.png", view(img));
在 64 位下使用 VS 2010 编译时。它说:
\boost\gil\extension\io\png_io_private.hpp(341): warning C4244: 'argument' : conversion from '__int64' to 'png_uint_32', possible loss of data
\boost\gil\extension\io\png_io.hpp(202) : see reference to function template instantiation 'void boost::gil::detail::png_writer::apply<View>(const View &)' being compiled
with
[
View=boost::gil::image_view<boost::gil::rgb8_loc_t>
]
main.cpp(20) : see reference to function template instantiation 'void boost::gil::png_write_view<boost::gil::image_view<Loc>>(const char *,const View &)' being compiled
with
[
Loc=boost::gil::rgb8_loc_t,
View=boost::gil::image_view<boost::gil::rgb8_loc_t>
]
似乎很明显,在 apply() 中对 png_set_IHDR() 的调用应该给出 png_uint_32,但 view.width() 似乎是有符号的 __int64(可能是 ptrdiff_t)。
有人知道我能做些什么吗?我猜 boost:gil 应该在 64 位下工作。
我使用升压 1_50。