On 04/02/2012 07:23 PM, David C. Rankin wrote:
I have also uncovered a digikam patch,
http://bugsfiles.kde.org/attachment.cgi?id=56384 , that 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
This patchfile is:
$NetBSD: patch-aa,v 1.11 2011/01/20 23:37:36 wiz Exp $
Fix build with png-1.5.
--- libs/dimg/loaders/pngloader.cpp.orig 2010-11-22 17:47:36.000000000 +0000
+++ libs/dimg/loaders/pngloader.cpp
@@ -494,7 +494,8 @@ bool PNGLoader::load(const QString& file
if (m_loadFlags & LoadICCData)
{
- png_charp profile_name, profile_data=NULL;
+ png_charp profile_name;
+ png_bytep profile_data=NULL;
png_uint_32 profile_size;
int compression_type;
@@ -730,7 +731,7 @@ bool PNGLoader::save(const QString& file
if (!profile_rawdata.isEmpty())
{
- png_set_iCCP(png_ptr, info_ptr, (png_charp)("icc"),
PNG_COMPRESSION_TYPE_BASE, profile_rawdata.data(), profile_rawdata.size());
+ png_set_iCCP(png_ptr, info_ptr, (png_charp)("icc"),
PNG_COMPRESSION_TYPE_BASE, (png_bytep)profile_rawdata.data(),
profile_rawdata.size());
}
There is a second patch that looks a bit more complete at:
http://bugsfiles.kde.org/attachment.cgi?id=56390
Index: libs/dimg/loaders/pngloader.cpp
===================================================================
--- libs/dimg/loaders/pngloader.cpp (revision 1216766)
+++ libs/dimg/loaders/pngloader.cpp (working copy)
@@ -73,6 +73,12 @@
namespace Digikam
{
+#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 5
+typedef png_bytep iCCP_data;
+#else
+typedef png_charp iCCP_data;
+#endif
+
PNGLoader::PNGLoader(DImg* image)
: DImgLoader(image)
{
@@ -574,7 +580,8 @@
if (m_loadFlags & LoadICCData)
{
- png_charp profile_name, profile_data=NULL;
+ png_charp profile_name;
+ iCCP_data profile_data=NULL;
png_uint_32 profile_size;
int compression_type;
@@ -854,7 +861,7 @@
if (!profile_rawdata.isEmpty())
{
- png_set_iCCP(png_ptr, info_ptr, (png_charp)("icc"),
PNG_COMPRESSION_TYPE_BASE, profile_rawdata.data(), profile_rawdata.size());
+ png_set_iCCP(png_ptr, info_ptr, (png_charp)("icc"),
PNG_COMPRESSION_TYPE_BASE, (iCCP_data)profile_rawdata.data(),
profile_rawdata.size());
}
--
David C. Rankin, J.D.,P.E.