summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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);