Hi all,

I have just checkout gil-contributions svn repo (http://code.google.com/p/gil-contributions/) in order to test new_io in which I am really interested. Thank you for this very usefull job! I have however some remarks and questions about some compilation issues.

0) The code seems to have been written and tested on Windows. Am I right (see my remarks thereafter)? For ex., why do you use "\\" in paths (paths.hpp) and not "/"?
1) Which Boost version is required? I first tried with 1.40, but it did not work because of missing accessors in boost::gil::variant (index() and bits()). Did they appear in 1.41 or 1.42? With 1.42, this issue is solved.
2) While compiling tests, I ran into some issues. I am running the code on an Ubuntu 9.10, with g++-4.3.4. I was able to fix some of them, but others are still problematic:
   2.1) For each test, I have to add at the beginning the 2 following lines:

#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE my application tests

         It probably comes from my little knowledge of boost unit_test_framework. Could you explain?

    2.2) For each test, the compiler gave the following error:

/usr/local/include/boost/gil/extension/io_new/detail/dynamic_io_new.hpp:75: error: there are no arguments to ‘io_error’ that depend on a template parameter, so a declaration of ‘io_error’ must be available

            I simply add in [...]/detail/dynamic_io_new.hpp an unclude directive at the beginning of the file : #include <boost/gil/extension/io/io_error.hpp>. Still do not understand how it can work wihtout this ...

     2.3) I had a similar error with [...]/formats/bmp/read.hpp:

/usr/local/include/boost/gil/extension/io_new/formats/bmp/read.hpp:833: error: there are no arguments to ‘get_info’ that depend on a template parameter, so a declaration of ‘get_info’ must be available

            I simply changed line 833 from get_info() to parent_t::get_info(). Now works.

     2.4) Some typename are missing (still do not know how visual can infer types ...):
            - [...]/formats/jpeg/read.hpp, line 336: typename Image::view_t
            - [...]/formats/bmp/is_allowed.hpp, line 73: typename View::value_type
            - [...]/formats/pnm/read.hpp, line 419: typename Image::view_t
            Everything works with these changes.

     2.5) png_read_test failed. Obviously, this is a portability issue. PNG filenames for testing are uppercase, while they are lowercase in the test code. I think that is also missing in the code the path to png files. For example, in basic_format_test, instead of

                   test_file< gray1_image_t >( "basn0g01.png" );
            it soulhd be:
                   test_file< gray1_image_t >( png_in + "BASN0G01.PNG" );
           I did not rename all files, so I am unable to try the test.

     2.6) Some tests fail to compile or link. Here are the errors:

            - all_formats_test.cpp:
In file included from /usr/include/png.h:481,
                 from /usr/local/include/boost/gil/extension/io_new/png_tags.hpp:23,
                 from /usr/local/include/boost/gil/extension/io_new/png_read.hpp:22,
                 from /usr/local/include/boost/gil/extension/io_new/png_all.hpp:22,
                 from /home/olivier/work/dev/lib/gil-contributions-read-only/gil_2/libs/gil/io_new/test/all_formats_test.cpp:7:
/usr/include/pngconf.h:335: error: expected constructor, destructor, or type conversion before ‘.’ token
/usr/include/pngconf.h:336: error: ‘__dont__’ does not name a type

            - pnm_reads_test.cpp:
pnm_read_test.cpp.o: In function `pnm_test::read_header_test::test_method()':
pnm_read_test.cpp:(.text+0x24c0): undefined reference to `boost::gil::pnm_image_type::_color_asc'
collect2: ld returned 1 exit status
              Do not really understand since _color_asc is a typedef defined in pnm_tags.hpp ...

            - jpeg_old_test.cpp (sorry for the message ...):
/usr/local/include/boost/gil/extension/io_new/formats/jpeg/write.hpp: In function ‘typename BinaryOp::result_type boost::gil::detail::apply_operation(const boost::gil::variant<Types>&, const Info&, BinaryOp) [with Types1 = boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::rgba8_pixel_t*> > >, boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::rgb8_pixel_t*> > >, boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::gray16_pixel_t*> > >, boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::gray8_pixel_t*> > >, boost::mpl::vector0<mpl_::na>, 0>, 0>, 0>, 0>, Info = boost::gil::image_write_info<boost::gil::jpeg_tag, boost::gil::detail::no_log>, BinaryOp = boost::gil::detail::dynamic_io_fnobj<boost::gil::detail::jpeg_write_is_supported, boost::gil::detail::writer<boost::gil::detail::file_stream_device<boost::gil::jpeg_tag>, boost::gil::jpeg_tag, boost::gil::detail::no_log> >]’:
/usr/local/include/boost/gil/extension/io_new/formats/jpeg/write.hpp:283:   instantiated from ‘void boost::gil::detail::dynamic_image_writer<Device, boost::gil::jpeg_tag, boost::gil::detail::no_log>::apply(const boost::gil::any_image_view<Views>&, const boost::gil::image_write_info<boost::gil::jpeg_tag, boost::gil::detail::no_log>&) [with Views = boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::rgba8_pixel_t*> > >, boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::rgb8_pixel_t*> > >, boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::gray16_pixel_t*> > >, boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::gray8_pixel_t*> > >, boost::mpl::vector0<mpl_::na>, 0>, 0>, 0>, 0>, Device = boost::gil::detail::file_stream_device<boost::gil::jpeg_tag>]’
/usr/local/include/boost/gil/extension/io_new/detail/write_view.hpp:302:   instantiated from ‘void boost::gil::write_view(Device&, const boost::gil::any_image_view<Types2>&, const boost::gil::image_write_info<FormatTag, Log>&, typename boost::enable_if<typename boost::mpl::and_<typename boost::gil::detail::is_output_device<IODevice>::type, typename boost::gil::is_format_tag<FormatTag>::type, mpl_::bool_<true>, mpl_::bool_<true>, mpl_::bool_<true> >::type, void>::type*) [with Device = boost::gil::detail::file_stream_device<boost::gil::jpeg_tag>, Views = boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::rgba8_pixel_t*> > >, boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::rgb8_pixel_t*> > >, boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::gray16_pixel_t*> > >, boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::gray8_pixel_t*> > >, boost::mpl::vector0<mpl_::na>, 0>, 0>, 0>, 0>, FormatTag = boost::gil::jpeg_tag, Log = boost::gil::detail::no_log]’
/usr/local/include/boost/gil/extension/io_new/detail/write_view.hpp:357:   instantiated from ‘void boost::gil::write_view(const String&, const boost::gil::any_image_view<Types2>&, const boost::gil::image_write_info<FormatTag, Log>&, typename boost::enable_if<typename boost::mpl::and_<typename boost::gil::detail::is_supported_path_spec<P>::type, typename boost::gil::is_format_tag<FormatTag>::type, mpl_::bool_<true>, mpl_::bool_<true>, mpl_::bool_<true> >::type, void>::type*) [with String = std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Views = boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::rgba8_pixel_t*> > >, boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::rgb8_pixel_t*> > >, boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::gray16_pixel_t*> > >, boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::gray8_pixel_t*> > >, boost::mpl::vector0<mpl_::na>, 0>, 0>, 0>, 0>, FormatTag = boost::gil::jpeg_tag, Log = boost::gil::detail::no_log]’
/usr/local/include/boost/gil/extension/io_new/jpeg_io_old.hpp:169:   instantiated from ‘void boost::gil::jpeg_write_view(const String&, const View&, int) [with String = std::basic_string<char, std::char_traits<char>, std::allocator<char> >, View = boost::gil::any_image_view<boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::rgba8_pixel_t*> > >, boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::rgb8_pixel_t*> > >, boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::gray16_pixel_t*> > >, boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::gray8_pixel_t*> > >, boost::mpl::vector0<mpl_::na>, 0>, 0>, 0>, 0> >]’
/home/olivier/work/dev/lib/gil-contributions-read-only/gil_2/libs/gil/io_new/test/jpeg_old_test.cpp:98:   instantiated from here
/usr/local/include/boost/gil/extension/io_new/formats/jpeg/write.hpp:243: error: invalid initialization of non-const reference of type ‘boost::gil::variant<boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::rgba8_pixel_t*> > >, boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::rgb8_pixel_t*> > >, boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::gray16_pixel_t*> > >, boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::gray8_pixel_t*> > >, boost::mpl::vector0<mpl_::na>, 0>, 0>, 0>, 0> >::base_t&’ from a temporary of type ‘boost::gil::variant<boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::rgba8_pixel_t*> > >, boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::rgb8_pixel_t*> > >, boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::gray16_pixel_t*> > >, boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::gray8_pixel_t*> > >, boost::mpl::vector0<mpl_::na>, 0>, 0>, 0>, 0> >::base_t’
/usr/local/include/boost/gil/extension/io_new/formats/jpeg/write.hpp:213: error: in passing argument 1 of ‘typename Op::result_type boost::gil::detail::apply_operation_base(Bits&, size_t, const Info&, Op) [with Types = boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::rgba8_pixel_t*> > >, boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::rgb8_pixel_t*> > >, boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::gray16_pixel_t*> > >, boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::gray8_pixel_t*> > >, boost::mpl::vector0<mpl_::na>, 0>, 0>, 0>, 0>, Info = boost::gil::image_write_info<boost::gil::jpeg_tag, boost::gil::detail::no_log>, Bits = boost::gil::variant<boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::rgba8_pixel_t*> > >, boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::rgb8_pixel_t*> > >, boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::gray16_pixel_t*> > >, boost::mpl::v_item<boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::gray8_pixel_t*> > >, boost::mpl::vector0<mpl_::na>, 0>, 0>, 0>, 0> >::base_t, Op = boost::gil::detail::dynamic_io_fnobj<boost::gil::detail::jpeg_write_is_supported, boost::gil::detail::writer<boost::gil::detail::file_stream_device<boost::gil::jpeg_tag>, boost::gil::jpeg_tag, boost::gil::detail::no_log> >]’
/usr/local/include/boost/gil/extension/io_new/formats/jpeg/write.hpp:243: error: return-statement with a value, in function returning 'void'


Apart png_read_test and its case sensitive problem, all compiled and linked tests run successfully. This is a really good new! However, could you please help regarding the issues above?
Please note that if you are intersted in a Linux developper/tester for gil, I am wiling to do some jobs ...


Best regards,

Olivier