~osomon/pyexiv2/pyexiv2-0.3

« back to all changes in this revision

Viewing changes to src/libpyexiv2_wrapper.cpp

  • Committer: Olivier Tilloy
  • Date: 2008-04-19 11:59:35 UTC
  • Revision ID: olivier@tilloy.net-20080419115935-nl0it4bi0ze8vyol
Refactor the structure of the exiv2 wrapper, retrieve more data for an EXIF tag.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// *****************************************************************************
2
 
/*
3
 
 * Copyright (C) 2006-2008 Olivier Tilloy <olivier@tilloy.net>
4
 
 *
5
 
 * This file is part of the pyexiv2 distribution.
6
 
 *
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.
11
 
 *
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.
16
 
 *
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.
20
 
 */
21
 
/*
22
 
  File:      libpyexiv2_wrapper.cpp
23
 
  Author(s): Olivier Tilloy <olivier@tilloy.net>
24
 
 */
25
 
// *****************************************************************************
26
 
 
27
 
#include "libpyexiv2.hpp"
28
 
 
29
 
#include <boost/python.hpp>
30
 
 
31
 
using namespace boost::python;
32
 
 
33
 
using namespace LibPyExiv2;
34
 
 
35
 
BOOST_PYTHON_MODULE(libpyexiv2)
36
 
{
37
 
        register_exception_translator<Exiv2::Error>(&translateExiv2Error);
38
 
 
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>())
42
 
 
43
 
                .def("readMetadata", &Image::readMetadata)
44
 
                .def("writeMetadata", &Image::writeMetadata)
45
 
 
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)
51
 
 
52
 
                .def("iptcKeys", &Image::iptcKeys)
53
 
                .def("_Image__getIptcTag", &Image::getIptcTag)
54
 
                .def("_Image__setIptcTag", &Image::setIptcTag)
55
 
                .def("_Image__deleteIptcTag", &Image::deleteIptcTag)
56
 
 
57
 
                .def("tagDetails", &Image::tagDetails)
58
 
 
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)
64
 
 
65
 
        .def("getComment", &Image::getComment)
66
 
        .def("setComment", &Image::setComment)
67
 
        .def("clearComment", &Image::clearComment)
68
 
        ;
69
 
}
70