diff options
author | Olivier Tilloy <olivier@tilloy.net> | 2009-03-14 22:03:42 +0100 |
---|---|---|
committer | Olivier Tilloy <olivier@tilloy.net> | 2009-03-14 22:03:42 +0100 |
commit | cc54370984d9b7c30e06d42a04a2d48e96f376d7 (patch) | |
tree | 53f9051f3d9528f82023ce0d57109396c9991368 /src | |
parent | e6f142d7a01ed42229d442de8c11faf8c4973312 (diff) | |
download | pyexiv2-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.cpp | 16 |
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); |