summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrell Anderson <humanreadable@yahoo.com>2012-05-06 16:32:18 -0500
committerDarrell Anderson <humanreadable@yahoo.com>2012-05-06 16:32:18 -0500
commitce22f23553bd8c77cfe649fe07ddc49905e79041 (patch)
treebc4a97c46d31cdfc41ca77532871c5948f7dfe38
parent9f6d6300404413190e22b40925c8842262a2e6e4 (diff)
downloadkipi-plugins-ce22f23553bd8c77cfe649fe07ddc49905e79041.tar.gz
kipi-plugins-ce22f23553bd8c77cfe649fe07ddc49905e79041.zip
Fix building with libpng 1.5.
Thanks to David C. Rankin and /dev/ammo42.
-rw-r--r--kipi-plugins/rawconverter/rawdecodingiface.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/kipi-plugins/rawconverter/rawdecodingiface.cpp b/kipi-plugins/rawconverter/rawdecodingiface.cpp
index c2653ee..3c67d38 100644
--- a/kipi-plugins/rawconverter/rawdecodingiface.cpp
+++ b/kipi-plugins/rawconverter/rawdecodingiface.cpp
@@ -68,6 +68,12 @@ extern "C"
namespace KIPIRawConverterPlugin
{
+#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
+
RawDecodingIface::RawDecodingIface()
: KDcrawIface::KDcraw()
{
@@ -249,7 +255,7 @@ bool RawDecodingIface::loadedFromDcraw(const TQString& filePath,
jpeg_set_quality(&cinfo, 99, true);
jpeg_start_compress(&cinfo, true);
- // Write ICC color profil.
+ // Write ICC color profile.
if (!ICCColorProfile.isEmpty())
write_icc_profile (&cinfo, (JOCTET *)ICCColorProfile.data(), ICCColorProfile.size());
@@ -295,11 +301,16 @@ bool RawDecodingIface::loadedFromDcraw(const TQString& filePath,
png_set_sBIT(png_ptr, info_ptr, &sig_bit);
png_set_compression_level(png_ptr, 9);
- // Write ICC profil.
+ // Write ICC profile.
if (!ICCColorProfile.isEmpty())
{
+#if PNG_LIBPNG_VER_MAJOR > 1 || ( PNG_LIBPNG_VER_MAJOR == 1 && PNG_LIBPNG_VER_MINOR >= 5 )
+ png_set_iCCP(png_ptr, info_ptr, ("icc"), PNG_COMPRESSION_TYPE_BASE,
+ reinterpret_cast<iCCP_data>(ICCColorProfile.data()), ICCColorProfile.size());
+#else
png_set_iCCP(png_ptr, info_ptr, "icc", PNG_COMPRESSION_TYPE_BASE,
ICCColorProfile.data(), ICCColorProfile.size());
+#endif
}
TQString libpngver(PNG_HEADER_VERSION_STRING);