summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2023-09-11 15:32:57 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2023-09-11 15:39:40 +0900
commitbf65e56e9e228134f6e151f99afc6370825bae82 (patch)
treed83b9e0f75375c4567841c83577d489a3e2f329e
parentd90ca2cd755d052237b390701300fcf73811d204 (diff)
downloadgwenview-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>
-rw-r--r--src/imageutils/jpegcontent.cpp22
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);