aboutsummaryrefslogtreecommitdiffstats
path: root/src/libpyexiv2.cpp
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2007-01-03 23:01:30 +0100
committerOlivier Tilloy <olivier@tilloy.net>2007-01-03 23:01:30 +0100
commit35bf3a8dcc8812a9956108f9b401f478cadc60f7 (patch)
treee731a603b2d2e7e47a54c6ddd1ae12732c5d3d61 /src/libpyexiv2.cpp
parent3eb675871bec989b3027622f6d615140daf76d41 (diff)
downloadpyexiv2-35bf3a8dcc8812a9956108f9b401f478cadc60f7.tar.gz
Implemented Image::setThumbnailData() that sets the thumbnail embedded in an image from raw jpeg data.
Diffstat (limited to 'src/libpyexiv2.cpp')
-rw-r--r--src/libpyexiv2.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/libpyexiv2.cpp b/src/libpyexiv2.cpp
index 79e8959..76c06ed 100644
--- a/src/libpyexiv2.cpp
+++ b/src/libpyexiv2.cpp
@@ -23,7 +23,7 @@
Author(s): Olivier Tilloy <olivier@tilloy.net>
History: 28-Dec-06, Olivier Tilloy: created
30-Dec-06, Olivier Tilloy: implemented IPTC-related methods
- 03-Jan-07, Olivier Tilloy: implemented getThumbnailData()
+ 03-Jan-07, Olivier Tilloy: implemented thumbnail-related methods
*/
// *****************************************************************************
@@ -434,10 +434,19 @@ namespace LibPyExiv2
}
}
- bool Image::setThumbnailData(boost::python::tuple data)
+ bool Image::setThumbnailData(std::string data)
{
- //TODO
- return true;
+ if(_dataRead)
+ {
+ const Exiv2::byte* dataBuf = (const Exiv2::byte*) data.c_str();
+ _exifData.setJpegThumbnail(dataBuf, data.size());
+ return true;
+ }
+ else
+ {
+ std::cerr << ">>> Image::setThumbnailData(): metadata not read yet, call Image::readMetadata() first" << std::endl;
+ return false;
+ }
}
} // End of namespace LibPyExiv2