~osomon/pyexiv2/pyexiv2-0.3

« back to all changes in this revision

Viewing changes to src/exiv2wrapper_python.cpp

  • Committer: Olivier Tilloy
  • Date: 2010-05-20 15:06:32 UTC
  • mfrom: (311.1.2 preview_wrapper)
  • Revision ID: olivier@tilloy.net-20100520150632-h2ymk5pu8as3lu47
Thin wrapper on top of libexiv2python.Preview, for a better encapsulation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
        .def("_getLangAltValue", &XmpTag::getLangAltValue)
97
97
    ;
98
98
 
99
 
    class_<Preview>("Preview",
100
 
                    "A preview image (properties and data buffer) embedded in "
101
 
                    "image metadata.",
102
 
                    init<Exiv2::PreviewImage>())
103
 
 
104
 
        .def_readonly("mime_type", &Preview::_mimeType,
105
 
                      "The mime type of the preview image (e.g. 'image/jpeg')")
106
 
        .def_readonly("extension", &Preview::_extension,
107
 
                      "The file extension of the preview image with a leading "
108
 
                      "dot (e.g. '.jpg')")
109
 
        .def_readonly("size", &Preview::_size,
110
 
                      "The size of the preview image in bytes")
111
 
        .def_readonly("dimensions", &Preview::_dimensions,
112
 
                      "A tuple containing the width and height of the preview "
113
 
                      "image in pixels")
114
 
        .def_readonly("data", &Preview::_data,
115
 
                      "The preview image data buffer")
116
 
 
117
 
        .def("write_to_file", &Preview::writeToFile,
118
 
             "Write the preview image to a file on disk.\n"
119
 
             "The file extension will be automatically appended to the path\n"
120
 
             "passed in parameter.")
 
99
    class_<Preview>("_Preview", init<Exiv2::PreviewImage>())
 
100
 
 
101
        .def_readonly("mime_type", &Preview::_mimeType)
 
102
        .def_readonly("extension", &Preview::_extension)
 
103
        .def_readonly("size", &Preview::_size)
 
104
        .def_readonly("dimensions", &Preview::_dimensions)
 
105
        .def_readonly("data", &Preview::_data)
 
106
 
 
107
        .def("write_to_file", &Preview::writeToFile)
121
108
    ;
122
109
 
123
110
    class_<Image>("_Image", init<std::string>())