diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-09-11 15:32:57 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-09-11 15:39:40 +0900 |
commit | bf65e56e9e228134f6e151f99afc6370825bae82 (patch) | |
tree | d83b9e0f75375c4567841c83577d489a3e2f329e /src | |
parent | d90ca2cd755d052237b390701300fcf73811d204 (diff) | |
download | gwenview-bf65e56e9e228134f6e151f99afc6370825bae82.tar.gz gwenview-bf65e56e9e228134f6e151f99afc6370825bae82.zip |
Fix FTBFS when using libexiv2 0.28.0. This resolves issue #7.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'src')
-rw-r--r-- | src/imageutils/jpegcontent.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/imageutils/jpegcontent.cpp b/src/imageutils/jpegcontent.cpp index 7efca9a..b4ad947 100644 --- a/src/imageutils/jpegcontent.cpp +++ b/src/imageutils/jpegcontent.cpp @@ -264,7 +264,11 @@ bool JPEGContent::loadFromData(const TQByteArray& data) { if (!d->readSize()) return false; +#if (EXIV2_TEST_VERSION(0,28,0)) + Exiv2::Image::UniquePtr image; +#else Exiv2::Image::AutoPtr image; +#endif try { image = Exiv2::ImageFactory::open((unsigned char*)data.data(), data.size()); image->readMetadata(); @@ -303,7 +307,11 @@ Orientation JPEGContent::orientation() const { if (it == d->mExifData.end()) { return NOT_AVAILABLE; } +#if (EXIV2_TEST_VERSION(0,28,0)) + return Orientation( it->toInt64() ); +#else return Orientation( it->toLong() ); +#endif } @@ -323,7 +331,11 @@ int JPEGContent::dotsPerMeter(const TQString& keyName) const { if (it == d->mExifData.end()) { return 0; } - int res = it->toLong(); +#if (EXIV2_TEST_VERSION(0,28,0)) + int64_t res = it->toInt64(); +#else + long res = it->toLong(); +#endif TQString keyVal = "Exif.Image." + keyName; Exiv2::ExifKey keyResolution(keyVal.ascii()); it = d->mExifData.findKey(keyResolution); @@ -604,7 +616,11 @@ TQImage JPEGContent::thumbnail() const { if (!d->mExifData.empty()) { Exiv2::ExifThumbC thumb(d->mExifData); Exiv2::DataBuf const thumbnail = thumb.copy(); +#if (EXIV2_TEST_VERSION(0,28,0)) + image.loadFromData(thumbnail.c_data(), thumbnail.size()); +#else image.loadFromData(thumbnail.pData_, thumbnail.size_); +#endif } return image; } @@ -652,7 +668,11 @@ bool JPEGContent::save(TQFile* file) { d->mPendingTransformation = false; } +#if (EXIV2_TEST_VERSION(0,28,0)) + Exiv2::Image::UniquePtr image = Exiv2::ImageFactory::open((unsigned char*)d->mRawData.data(), d->mRawData.size()); +#else Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open((unsigned char*)d->mRawData.data(), d->mRawData.size()); +#endif // Store Exif info image->setExifData(d->mExifData); |