diff options
-rw-r--r-- | kipi-plugins/rawconverter/rawdecodingiface.cpp | 15 |
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); |