summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrell Anderson <humanreadable@yahoo.com>2012-04-27 23:18:48 -0500
committerSlávek Banko <slavek.banko@axis.cz>2012-06-28 02:54:19 +0200
commitaff49594f5cbc82210cffde3d7328e6f90bd0ef3 (patch)
tree5e07fd98db3a2acb60ac00abf093ed0b5673e370
parent6dd8615cc4ffa35c6fa5627a11b7fce95f4f31f9 (diff)
downloaddigikam-aff49594f5cbc82210cffde3d7328e6f90bd0ef3.tar.gz
digikam-aff49594f5cbc82210cffde3d7328e6f90bd0ef3.zip
GCC 4.7 fix.
This partially resolves bug report 958. Thanks to David C. Rankin. (cherry picked from commit a94890345ef2caae35a72ed3a398b2984349bb2f)
-rw-r--r--digikam/libs/dimg/loaders/pngloader.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/digikam/libs/dimg/loaders/pngloader.cpp b/digikam/libs/dimg/loaders/pngloader.cpp
index fd5d771a..fa6dad9b 100644
--- a/digikam/libs/dimg/loaders/pngloader.cpp
+++ b/digikam/libs/dimg/loaders/pngloader.cpp
@@ -57,6 +57,12 @@ extern "C"
namespace Digikam
{
+#if PNG_LIBPNG_VER_MAJOR > 1 || ( 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)
{
@@ -403,7 +409,12 @@ bool PNGLoader::load(const TQString& filePath, DImgLoaderObserver *observer)
TQMap<int, TQByteArray>& metaData = imageMetaData();
+#if PNG_LIBPNG_VER_MAJOR > 1 || ( PNG_LIBPNG_VER_MAJOR == 1 && PNG_LIBPNG_VER_MINOR >= 5 )
+ png_charp profile_name;
+ iCCP_data profile_data=NULL;
+#else
png_charp profile_name, profile_data=NULL;
+#endif
png_uint_32 profile_size;
int compression_type;
@@ -599,7 +610,11 @@ bool PNGLoader::save(const TQString& filePath, DImgLoaderObserver *observer)
if (!profile_rawdata.isEmpty())
{
+#if PNG_LIBPNG_VER_MAJOR > 1 || ( PNG_LIBPNG_VER_MAJOR == 1 && PNG_LIBPNG_VER_MINOR >= 5 )
+ png_set_iCCP(png_ptr, info_ptr, (png_charp)("icc"), PNG_COMPRESSION_TYPE_BASE, (iCCP_data)profile_rawdata.data(), profile_rawdata.size());
+#else
png_set_iCCP(png_ptr, info_ptr, (png_charp)"icc", PNG_COMPRESSION_TYPE_BASE, profile_rawdata.data(), profile_rawdata.size());
+#endif
}
// -------------------------------------------------------------------