diff options
author | Olivier Tilloy <olivier@tilloy.net> | 2007-01-07 22:18:30 +0100 |
---|---|---|
committer | Olivier Tilloy <olivier@tilloy.net> | 2007-01-07 22:18:30 +0100 |
commit | 7ef926c1493c544d75e805a149999987d6146597 (patch) | |
tree | a10efd544382ab5702468cccce9d00d660d3777b /src/libpyexiv2.cpp | |
parent | 559735fd514a3f29c12870e60be8d878a5bc97be (diff) | |
download | pyexiv2-7ef926c1493c544d75e805a149999987d6146597.tar.gz |
Added method Image::setThumbnailFromJpegFile(...) that allows setting the image thumbnail from a jpeg file.
Diffstat (limited to 'src/libpyexiv2.cpp')
-rw-r--r-- | src/libpyexiv2.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/libpyexiv2.cpp b/src/libpyexiv2.cpp index 389f2c1..2c8fb4d 100644 --- a/src/libpyexiv2.cpp +++ b/src/libpyexiv2.cpp @@ -493,4 +493,26 @@ namespace LibPyExiv2 } } + bool Image::setThumbnailFromJpegFile(const std::string path) + { + if(_dataRead) + { + try + { + _exifData.setJpegThumbnail(path); + return true; + } + catch(Exiv2::Error& e) + { + std::cerr << ">>> Image::setThumbnailFromJpegFile(): caught Exiv2 exception '" << e << "'"; + return false; + } + } + else + { + std::cerr << ">>> Image::setThumbnailFromJpegFile(): metadata not read yet, call Image::readMetadata() first" << std::endl; + return false; + } + } + } // End of namespace LibPyExiv2 |