By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release.
Bug 949 - Build issue: libpng15 deprecates direct access to png_struct & png_info
Summary: Build issue: libpng15 deprecates direct access to png_struct & png_info
Status: RESOLVED FIXED
Alias: None
Product: TDE
Classification: Unclassified
Component: other (any) (show other bugs)
Version: R14.0.0 [Trinity]
Hardware: Other Linux
: P5 critical
Assignee: Timothy Pearson
URL:
Depends on:
Blocks:
 
Reported: 2012-03-28 11:09 CDT by David C. Rankin
Modified: 2012-04-27 23:32 CDT (History)
2 users (show)

See Also:
Compiler Version:
TDE Version String:
Application Version:
Application Name:


Attachments
Attempted patch created from KDE.org patch - FAILED (1.06 KB, patch)
2012-04-04 01:43 CDT, David C. Rankin
Details | Diff
gcc 4.7 + libpng 1.5 patch for digikam (consolidated) (1.67 KB, patch)
2012-04-19 17:03 CDT, David C. Rankin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David C. Rankin 2012-03-28 11:09:02 CDT
The current stable realease of libpng deprecated direct access to png_struct & png_info causing build failures for apps that relied on direct access to the structures. Current failures have been identified in:

digikam - 

pngloader.cpp:123:9: error: invalid use of incomplete type 'png_struct {aka struct png_struct_def}'
/usr/include/png.h:855:16: error: forward declaration of 'png_struct {aka struct png_struct_def}'

gwenview - 

pngformattype.cpp: In function 'void Gwenview::setup_qt(TQImage&, png_structp, png_infop)':
pngformattype.cpp:214:33: error: invalid use of incomplete type 'png_info {aka struct png_info_def}'
/usr/include/png.h:724:16: error: forward declaration of 'png_info {aka struct png_info_def}'

The libpng-manual.txt file explains the change:

II. Structures

There are two main structures that are important to libpng, png_struct
and png_info.  Both are internal structures that are no longer exposed
in the libpng interface (as of libpng 1.5.0).

The png_info structure is designed to provide information about the
PNG file.  At one time, the fields of png_info were intended to be
directly accessible to the user.  However, this tended to cause problems
with applications using dynamically loaded libraries, and as a result
a set of interface functions for png_info (the png_get_*() and png_set_*()
functions) was developed, and direct access to the png_info fields was
deprecated..

The png_struct structure is the object used by the library to decode a
single image.  As of 1.5.0 this structure is also not exposed.

  I am working to see if I can help with a patch, but my patch skills at this level of c++ are dubious. Think about the level this bug need to be elevated to. With major apps broken by the change, you may want to elevate it to BLOCKER.
Comment 1 David C. Rankin 2012-04-03 23:08:27 CDT
This same issues causes the koffice build to fail. Darrell was able to take a patch from the NetBSD build and get gwenview to build, but so far, the solution for digikam and koffice (which will be similar) are beyond our grasp.

The koffice build failure looks like:

libtool: compile:  g++ -
<snip>
 -MT kis_wdg_options_png.lo -MD -MP -MF .deps/kis_wdg_options_png.Tpo -c kis_wdg_options_png.cc  -fPIC -DPIC -o .libs/kis_wdg_options_png.o
In file included from kis_png_import.cc:24:0:
../../../lib/kofficecore/KoFilterChain.h:149:53: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
In file included from kis_png_export.cc:29:0:
../../../lib/kofficecore/KoFilterChain.h:149:53: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
In file included from kis_png_converter.cc:40:0:
../../../chalk/core/kis_layer.h:170:34: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
kis_png_converter.cc: In member function 'KisImageBuilder_Result KisPNGConverter::decode(const KURL&)':
kis_png_converter.cc:233:97: error: invalid conversion from 'char**' to 'png_bytepp {aka unsigned char**}' [-fpermissive]
/usr/include/png.h:2267:1: error:   initializing argument 5 of 'png_uint_32 png_get_iCCP(png_const_structp, png_const_infop, png_charpp, int*, png_bytepp, png_uint_32*)' [-fpermissive]
kis_png_converter.cc: In member function 'KisImageBuilder_Result KisPNGConverter::buildFile(const KURL&, KisPaintLayerSP, vKisAnnotationSP_it, vKisAnnotationSP_it, int, bool, bool)':
kis_png_converter.cc:528:43: error: 'Z_DEFAULT_STRATEGY' was not declared in this scope
kis_png_converter.cc:630:143: error: invalid conversion from 'char*' to 'png_const_bytep {aka const unsigned char*}' [-fpermissive]
/usr/include/png.h:2274:1: error:   initializing argument 5 of 'void png_set_iCCP(png_structp, png_infop, png_const_charp, int, png_const_bytep, png_uint_32)' [-fpermissive]
kis_png_converter.cc:643:47: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
kis_png_converter.cc:649:53: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
kis_png_converter.cc:656:49: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
In file included from ../../../chalk/core/kis_paint_layer.h:22:0,
                 from kis_png_export.cc:35:
../../../chalk/core/kis_layer.h:170:34: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
In file included from kis_png_converter.cc:793:0:
kis_png_converter.cc: In member function 'KisImageBuilder_Result KisPNGConverter::decode(const KURL&)':
kis_png_converter.cc:164:31: warning: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
make[4]: *** [kis_png_converter.lo] Error 1

  A common solution would probably fix digikam, gwenview and koffice. libjpeg update to stable has also caused additional problems in digikam. It will most likely affect other apps in the tree:

-DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -DQT_CLEAN_NAMESPACE -MT
jpegloader.lo -MD -MP -MF .deps/jpegloader.Tpo -c jpegloader.cpp  -fPIC -DPIC -o
.libs/jpegloader.o
jpegloader.cpp: In member function 'virtual bool Digikam::JPEGLoader::load(const
TQString&, Digikam::DImgLoaderObserver*)':
jpegloader.cpp:191:12: warning: enumeration value 'JCS_EXT_RGB' not handled in
switch [-Wswitch]
jpegloader.cpp:191:12: warning: enumeration value 'JCS_EXT_RGBX' not handled in
switch [-Wswitch]
jpegloader.cpp:191:12: warning: enumeration value 'JCS_EXT_BGR' not handled in
switch [-Wswitch]
jpegloader.cpp:191:12: warning: enumeration value 'JCS_EXT_BGRX' not handled in
switch [-Wswitch]
jpegloader.cpp:191:12: warning: enumeration value 'JCS_EXT_XBGR' not handled in
switch [-Wswitch]
jpegloader.cpp:191:12: warning: enumeration value 'JCS_EXT_XRGB' not handled in
switch [-Wswitch]
jpegloader.cpp:191:12: warning: enumeration value 'JCS_EXT_RGBA' not handled in
switch [-Wswitch]
jpegloader.cpp:191:12: warning: enumeration value 'JCS_EXT_BGRA' not handled in
switch [-Wswitch]
jpegloader.cpp:191:12: warning: enumeration value 'JCS_EXT_ABGR' not handled in
switch [-Wswitch]
jpegloader.cpp:191:12: warning: enumeration value 'JCS_EXT_ARGB' not handled in
switch [-Wswitch]
jpegloader.cpp:223:31: warning: variable 'count' set but not used
[-Wunused-but-set-variable]
jpegloader.cpp:223:38: warning: variable 'prevy' set but not used
[-Wunused-but-set-variable]
pngloader.cpp: In member function 'virtual bool Digikam::PNGLoader::load(const
TQString&, Digikam::DImgLoaderObserver*)':
pngloader.cpp:123:9: error: invalid use of incomplete type 'png_struct {aka
struct png_struct_def}'
/usr/include/png.h:855:16: error: forward declaration of 'png_struct {aka struct
png_struct_def}'
pngloader.cpp:410:99: warning: invalid conversion from 'char**' to 'png_bytepp
{aka unsigned char**}' [-fpermissive]
pngloader.cpp: In member function 'virtual bool Digikam::PNGLoader::save(const
TQString&, Digikam::DImgLoaderObserver*)'
Comment 2 David C. Rankin 2012-04-03 23:18:10 CDT
A current list of the related patches I have found is:

Digikam:

  I don't think is a direct patch for this problem, but hopefully it will help a bit. The patch is labeled:

[Digikam-devel] [Bug 264181] New: png-1.5 compatibility fix
http://mail.kde.org/pipermail/digikam-devel/2011-January/048984.html

patch: http://bugsfiles.kde.org/attachment.cgi?id=56384

  Second patch (presumably qt4/kde4 related)

patch: http://bugsfiles.kde.org/attachment.cgi?id=56390

Gwenview:

  Bug:  https://bugs.kde.org/show_bug.cgi?id=266319

  patch: https://bugs.kde.org/attachment.cgi?id=57257

  darrell's patch - allowed gwenview to build:

  http://humanreadable.nfshost.com/trinity/patches/tqt-fixes/gwenview-libpng15-tde.diff

  I haven't found a koffice patch yet, but if the solution is found for digikam, it should be almost identical for koffice.
Comment 3 David C. Rankin 2012-04-04 01:43:09 CDT
Created attachment 517 [details]
Attempted patch created from KDE.org patch - FAILED

I Attempted to reconstitute and apply the patch obtained from KDE.org. It failed with the familiar message:

pngloader.cpp: In member function 'virtual bool Digikam::PNGLoader::load(const TQString&, Digikam::DImgLoaderObserver*)':
pngloader.cpp:129:9: error: invalid use of incomplete type 'png_struct {aka struct png_struct_def}'
/usr/include/png.h:855:16: error: forward declaration of 'png_struct {aka struct png_struct_def}'
pngloader.cpp: In member function 'virtual bool Digikam::PNGLoader::save(const TQString&, Digikam::DImgLoaderObserver*)':
pngloader.cpp:536:9: error: invalid use of incomplete type 'png_struct {aka struct png_struct_def}'
/usr/include/png.h:855:16: error: forward declaration of 'png_struct {aka struct png_struct_def}'
pngloader.cpp:669:39: warning: deprecated conversion from string constant to 'png_charp {aka char*}' [-Wwrite-strings]
pngloader.cpp: In member function 'long int Digikam::PNGLoader::formatStringList(char*, size_t, const char*, __va_list_tag*)':
pngloader.cpp:977:55: warning: function might be possible candidate for 'gnu_printf' format attribute [-Wmissing-format-attribute]
pngloader.cpp: In member function 'virtual bool Digikam::PNGLoader::load(const TQString&, Digikam::DImgLoaderObserver*)':
pngloader.cpp:96:41: warning: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
Comment 4 David C. Rankin 2012-04-19 17:03:56 CDT
Created attachment 553 [details]
gcc 4.7 + libpng 1.5 patch for digikam (consolidated)

This patch resolves the digikam libpng 1.5 and gcc 4.7 issues. This patch is also part of the patch of like description attached to bug 958. Unless additional preprocessor conditions are required, then this bug can be closed after the patch is pushed to GIT.
Comment 5 Darrell 2012-04-27 23:32:21 CDT
Patches pushed in GIT hash a209c81b. Resolved.

Commit report says the patches partially resolved bug report 959. Oops!

Thank you for the patches!