summaryrefslogtreecommitdiffstats
path: root/kipi-plugins
diff options
context:
space:
mode:
authorDarrell Anderson <humanreadable@yahoo.com>2012-05-06 16:32:18 -0500
committerSlávek Banko <slavek.banko@axis.cz>2012-06-28 02:59:02 +0200
commit2b85e6d74a601926016df008a46684fd6be549e4 (patch)
tree43822ca08c3eb9c73852e2ec485fa3753a3bed6c /kipi-plugins
parentca19e545953634b4fb382b24dafa66d9182fa0b2 (diff)
downloadkipi-plugins-2b85e6d74a601926016df008a46684fd6be549e4.tar.gz
kipi-plugins-2b85e6d74a601926016df008a46684fd6be549e4.zip
Fix building with libpng 1.5.
Thanks to David C. Rankin and /dev/ammo42. (cherry picked from commit ce22f23553bd8c77cfe649fe07ddc49905e79041)
Diffstat (limited to 'kipi-plugins')
-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 d9d8e5f..f8330ce 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);