Bug 264181 - png-1.5 compatibility fix
Summary: png-1.5 compatibility fix
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-DImg-PNG (show other bugs)
Version: 1.8.0
Platform: NetBSD pkgsrc All
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-24 16:55 UTC by Thomas Klausner
Modified: 2017-07-30 16:30 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 1.9.0


Attachments
Patch fixing the problem. (982 bytes, patch)
2011-01-24 16:55 UTC, Thomas Klausner
Details
Patch fixing the problem, but supporting libpng 1.4 or earlier (1.14 KB, patch)
2011-01-24 18:02 UTC, Andrew Coles
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Klausner 2011-01-24 16:55:35 UTC
Created attachment 56384 [details]
Patch fixing the problem.

Version:           1.8.0 (using KDE 4.5.4) 
OS:                All

In png-1.5, the prototype for png_set_iCCCP changed. The fifth argument was a png_charp and is now a png_bytep.

Reproducible: Always

Steps to Reproduce:
Compile digikam against png-1.5.

Actual Results:  
Here's the output from digikam-1.6.0, but the code is the same in SVN:

libs/dimg/loaders/pngloader.cpp: In member function 'virtual bool Digikam::PNGLoader::load(const QString&, Digikam::DImgLoaderObserver*)':
libs/dimg/loaders/pngloader.cpp:501: error: invalid conversion from 'char**' to 'png_byte**'
libs/dimg/loaders/pngloader.cpp:501: error:   initializing argument 5 of 'png_uint_32 png_get_iCCP(const png_struct*, const png_info*, char**, int*, png_byte**, png_uint_32*)'
libs/dimg/loaders/pngloader.cpp: In member function 'virtual bool Digikam::PNGLoader::save(const QString&, Digikam::DImgLoaderObserver*)':
libs/dimg/loaders/pngloader.cpp:733: error: invalid conversion from 'char*' to 'const png_byte*'
libs/dimg/loaders/pngloader.cpp:733: error:   initializing argument 5 of 'void png_set_iCCP(png_struct*, png_info*, const char*, int, const png_byte*, png_uint_32)'


Expected Results:  
Successful compilation :)

I've attached a patch that fixes the problem with 1.5.0.
It probably needs changes to still work against older versions (which I don't have installed).
Comment 1 Andrew Coles 2011-01-24 18:02:16 UTC
Created attachment 56390 [details]
Patch fixing the problem, but supporting libpng 1.4 or earlier

Hi Thomas,

Thanks for reporting.  Attached is a new patch that should work with 1.4 and 1.5.  Could you double-check it works on 1.5?

Thanks,

Andrew
Comment 2 caulier.gilles 2011-01-24 19:51:09 UTC
Andrew,

If patch work fine with 1.5, please apply it to trunk. I will sync GoSC2010 later...

Gilles
Comment 3 Thomas Klausner 2011-01-24 23:53:54 UTC
Andrew, your patch works fine with png-1.5. Thanks!
Comment 4 Andrew Coles 2011-01-25 11:18:55 UTC
SVN commit 1216968 by coles:

Support for libpng 1.5 - the type for iCCP data has changed.

BUG: 264181



 M  +9 -2      pngloader.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1216968