aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2009-03-14 22:03:42 +0100
committerOlivier Tilloy <olivier@tilloy.net>2009-03-14 22:03:42 +0100
commitcc54370984d9b7c30e06d42a04a2d48e96f376d7 (patch)
tree53f9051f3d9528f82023ce0d57109396c9991368 /src
parente6f142d7a01ed42229d442de8c11faf8c4973312 (diff)
downloadpyexiv2-cc54370984d9b7c30e06d42a04a2d48e96f376d7.tar.gz
Adapted the dumpThumbnailToFile and setThumbnailFromJpegFile methods to the API of libexiv2 0.18.
Diffstat (limited to 'src')
-rw-r--r--src/libpyexiv2.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/libpyexiv2.cpp b/src/libpyexiv2.cpp
index b5a81fc..1c44918 100644
--- a/src/libpyexiv2.cpp
+++ b/src/libpyexiv2.cpp
@@ -365,10 +365,14 @@ namespace LibPyExiv2
{
if(_dataRead)
{
- //int result = _exifData.writeThumbnail(path);
- //if (result == 8)
- // throw Exiv2::Error(NO_THUMBNAIL);
- 1;
+ Exiv2::ExifThumb thumbnail(_exifData);
+ std::string mimetype(thumbnail.mimeType());
+ if (mimetype == "")
+ {
+ // The image does not contain an EXIF thumbnail
+ throw Exiv2::Error(NO_THUMBNAIL);
+ }
+ thumbnail.writeFile(path);
}
else
throw Exiv2::Error(METADATA_NOT_READ);
@@ -378,8 +382,8 @@ namespace LibPyExiv2
{
if(_dataRead)
{
- //_exifData.setJpegThumbnail(path);
- 1;
+ Exiv2::ExifThumb thumbnail(_exifData);
+ thumbnail.setJpegThumbnail(path);
}
else
throw Exiv2::Error(METADATA_NOT_READ);