Opened 13 years ago

Closed 4 years ago

#3908 closed Bugs (fixed)

using boost::gil fails when upgrading to libpng-1.4.0

Reported by: greg.r.rogers@… Owned by: Stefan Seefeld
Milestone: Boost 1.68.0 Component: gil USE GITHUB
Version: Boost 1.53.0 Severity: Problem
Keywords: gil png libpng incompatible Cc: blelbach@…, yves.pausch@…, mateusz@…

Description

libpng version 1.4.0 (up from 1.2.40) removes several macros such as the following:

#define png_infopp_NULL NULL

Which GIL was using.

Fix: Replacing the symbols png_infopp_NULL and int_p_NULL with NULL in the files boost/gil/extension/io/png_io_private.hpp and boost/gil/extension/io/png_dynamic_io.hpp seems to fix the problem.

Note: I have only compiled, I have not actually used the functions which use these symbols.

Change History (11)

comment:1 by anonymous, 12 years ago

Done. Ticket is closed.

comment:2 by chhenning, 12 years ago

Resolution: fixed
Status: newclosed

comment:3 by Bryce Adelstein Lelbach, 12 years ago

Resolution: fixed
Status: closedreopened

Reports in IRC indicate this is still a problem.

comment:4 by Bryce Adelstein Lelbach, 12 years ago

In file included from /usr/include/boost/gil/extension/io/png_io.hpp:41:0,
                 from ../src/write.cxx:4:
/usr/include/boost/gil/extension/io/png_io_private.hpp: In member function ‘void boost::gil::detail::png_reader_color_convert<CC>::apply(const View&)’:
/usr/include/boost/gil/extension/io/png_io_private.hpp:228:22: error: ‘int_p_NULL’ was not declared in this scope

Reported by ville on IRC (ville3.14159@…).

Build environment:

  • GCC 4.5.2
  • Linux 2.6.37 (Arch-Linux distro)
  • Boost 1.46.0 (Arch-Linux packaged)
  • libpng 1.4.5-1 (Arch-Linux packaged)

comment:5 by Bryce Adelstein Lelbach, 12 years ago

Cc: blelbach@… added
Milestone: Boost 1.43.0Boost 1.47.0
Version: Boost 1.42.0Boost 1.46.0

comment:6 by anonymous, 11 years ago

Hi,

When using boost-1.49.0 with libpng-1.5.9 I also get this:

/xxxxx/w/slc5_amd64_gcc461/external/boost/1.49.0/include/boost/gil/extension/io/png_io_private.hpp: I
n member function 'void boost::gil::detail::png_reader_color_convert<CC>::apply(const View&)':
/xxxxx/w/slc5_amd64_gcc461/external/boost/1.49.0/include/boost/gil/extension/io/png_io_private.hpp:22
8:22: error: 'int_p_NULL' was not declared in this scope

Grepping the boost tree also finds other occurrences:

$ egrep -r 'png_infopp_NULL|int_p_NULL' w/BUILD/slc5_amd64_gcc461/external/boost/1.49.0
w/BUILD/slc5_amd64_gcc461/external/boost/1.49.0/boost_1_49_0/libs/gil/doc/html/g_i_l_0250.html:<a name="l00091"></a>00091                      int_p_NULL, int_p_NULL);
w/BUILD/slc5_amd64_gcc461/external/boost/1.49.0/boost_1_49_0/libs/gil/doc/html/g_i_l_0253.html:<a name="l00155"></a>00155             png_destroy_read_struct(&amp;_png_ptr,png_infopp_NULL,png_infopp_NULL);
w/BUILD/slc5_amd64_gcc461/external/boost/1.49.0/boost_1_49_0/libs/gil/doc/html/g_i_l_0253.html:<a name="l00160"></a>00160             png_destroy_read_struct(&amp;_png_ptr, &amp;_info_ptr, png_infopp_NULL);
w/BUILD/slc5_amd64_gcc461/external/boost/1.49.0/boost_1_49_0/libs/gil/doc/html/g_i_l_0253.html:<a name="l00174"></a>00174         png_destroy_read_struct(&amp;_png_ptr,&amp;_info_ptr,png_infopp_NULL);
w/BUILD/slc5_amd64_gcc461/external/boost/1.49.0/boost_1_49_0/libs/gil/doc/html/g_i_l_0253.html:<a name="l00186"></a>00186                      int_p_NULL, int_p_NULL);
w/BUILD/slc5_amd64_gcc461/external/boost/1.49.0/boost_1_49_0/libs/gil/doc/html/g_i_l_0253.html:<a name="l00228"></a>00228                      int_p_NULL, int_p_NULL);
w/BUILD/slc5_amd64_gcc461/external/boost/1.49.0/boost_1_49_0/libs/gil/doc/html/g_i_l_0253.html:<a name="l00317"></a>00317             png_destroy_write_struct(&amp;_png_ptr,png_infopp_NULL);
w/BUILD/slc5_amd64_gcc461/external/boost/1.49.0/boost_1_49_0/boost/gil/extension/io/png_io_private.hpp:                     int_p_NULL, int_p_NULL);

Could you please confirm that the change png_infopp_NULL|int_p_NULL to NULL would fix the problem?

Cheers, Diego Gomes.

comment:7 by anonymous, 10 years ago

I can confirm this problem using Fedora 18 Linux.
boost-devel-1.50.0-4.fc18.x86_64
gcc-4.7.2-8.fc18.x86_64

comment:8 by yves.pausch@…, 10 years ago

Cc: yves.pausch@… added
Keywords: gil png libpng incompatible added
Milestone: Boost 1.47.0Boost 1.54.0
Version: Boost 1.46.0Boost 1.53.0

Same here with libpng 1.5.13

comment:9 by Mateusz Loskot, 6 years ago

Cc: mateusz@… added

comment:10 by Stefan Seefeld, 5 years ago

Owner: changed from Hailin Jin to Stefan Seefeld
Status: reopenednew

comment:11 by Mateusz Loskot, 4 years ago

Milestone: Boost 1.54.0Boost 1.68.0
Resolution: fixed
Status: newclosed

GIL in Boost 1.68 delivers completely re-implemented I/O extensions. The new version does not use the troublesome macros, so the issue should be gone now.

Closing as fixed.

GitHub ref: https://github.com/boostorg/gil/projects/4#card-12368324

Note: See TracTickets for help on using tickets.