1
// *****************************************************************************
3
* Copyright (C) 2006-2008 Olivier Tilloy <olivier@tilloy.net>
5
* This file is part of the pyexiv2 distribution.
7
* pyexiv2 is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public License
9
* as published by the Free Software Foundation; either version 2
10
* of the License, or (at your option) any later version.
12
* pyexiv2 is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with pyexiv2; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA.
22
File: libpyexiv2_wrapper.cpp
23
Author(s): Olivier Tilloy <olivier@tilloy.net>
25
// *****************************************************************************
27
#include "libpyexiv2.hpp"
29
#include <boost/python.hpp>
31
using namespace boost::python;
33
using namespace LibPyExiv2;
35
BOOST_PYTHON_MODULE(libpyexiv2)
37
register_exception_translator<Exiv2::Error>(&translateExiv2Error);
39
// Exported method names prefixed by "_Image__" are going to be "private"
40
// and are not meant to be used directly
41
class_<Image>("Image", init<std::string>())
43
.def("readMetadata", &Image::readMetadata)
44
.def("writeMetadata", &Image::writeMetadata)
46
.def("exifKeys", &Image::exifKeys)
47
.def("_Image__getExifTag", &Image::getExifTag)
48
.def("_Image__getExifTagToString", &Image::getExifTagToString)
49
.def("_Image__setExifTag", &Image::setExifTag)
50
.def("_Image__deleteExifTag", &Image::deleteExifTag)
52
.def("iptcKeys", &Image::iptcKeys)
53
.def("_Image__getIptcTag", &Image::getIptcTag)
54
.def("_Image__setIptcTag", &Image::setIptcTag)
55
.def("_Image__deleteIptcTag", &Image::deleteIptcTag)
57
.def("tagDetails", &Image::tagDetails)
59
.def("getThumbnailData", &Image::getThumbnailData)
60
.def("setThumbnailData", &Image::setThumbnailData)
61
.def("deleteThumbnail", &Image::deleteThumbnail)
62
.def("dumpThumbnailToFile", &Image::dumpThumbnailToFile)
63
.def("setThumbnailFromJpegFile", &Image::setThumbnailFromJpegFile)
65
.def("getComment", &Image::getComment)
66
.def("setComment", &Image::setComment)
67
.def("clearComment", &Image::clearComment)