From e238aa77b1fb3c2f55aef2ef2c91ce52166d2cc8 Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 7 Sep 2010 07:47:22 +0000 Subject: EXIV2 patch git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/gwenview@1172409 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/imageutils/jpegcontent.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src') diff --git a/src/imageutils/jpegcontent.cpp b/src/imageutils/jpegcontent.cpp index 9c8efeb..d23d74f 100644 --- a/src/imageutils/jpegcontent.cpp +++ b/src/imageutils/jpegcontent.cpp @@ -47,6 +47,17 @@ extern "C" { #include "imageutils/jpegcontent.h" #include "imageutils/jpegerrormanager.h" +// Make sure an EXIV2_TEST_VERSION macro exists: + +#ifdef EXIV2_VERSION +# ifndef EXIV2_TEST_VERSION +# define EXIV2_TEST_VERSION(major,minor,patch) \ + ( EXIV2_VERSION >= EXIV2_MAKE_VERSION(major,minor,patch) ) +# endif +#else +# define EXIV2_TEST_VERSION(major,minor,patch) (false) +#endif + namespace ImageUtils { const int INMEM_DST_DELTA=4096; @@ -594,7 +605,12 @@ void JPEGContent::applyPendingTransformation() { QImage JPEGContent::thumbnail() const { QImage image; if (!d->mExifData.empty()) { +#if (EXIV2_TEST_VERSION(0,17,91)) + Exiv2::ExifThumbC thumb(d->mExifData); + Exiv2::DataBuf const thumbnail = thumb.copy(); +#else Exiv2::DataBuf thumbnail = d->mExifData.copyThumbnail(); +#endif image.loadFromData(thumbnail.pData_, thumbnail.size_); } return image; @@ -616,7 +632,12 @@ void JPEGContent::setThumbnail(const QImage& thumbnail) { return; } +#if (EXIV2_TEST_VERSION(0,17,91)) + Exiv2::ExifThumb thumb(d->mExifData); + thumb.setJpegThumbnail((unsigned char*)array.data(), array.size()); +#else d->mExifData.setJpegThumbnail((unsigned char*)array.data(), array.size()); +#endif } -- cgit v1.2.1