Fix building with libpng 1.5.

Thanks to David C. Rankin and /dev/ammo42.
pull/1/head
Darrell Anderson 13 years ago
parent 9f6d630040
commit ce22f23553

@ -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);

Loading…
Cancel
Save