diff options
-rw-r--r-- | src/exiv2wrapper.cpp | 6 | ||||
-rw-r--r-- | src/exiv2wrapper.hpp | 3 | ||||
-rw-r--r-- | src/exiv2wrapper_python.cpp | 2 | ||||
-rw-r--r-- | src/pyexiv2/metadata.py | 5 |
4 files changed, 16 insertions, 0 deletions
diff --git a/src/exiv2wrapper.cpp b/src/exiv2wrapper.cpp index 45ee5e1..b6c85cf 100644 --- a/src/exiv2wrapper.cpp +++ b/src/exiv2wrapper.cpp @@ -118,6 +118,12 @@ unsigned int Image::pixelHeight() const return _image->pixelHeight(); } +std::string Image::mimeType() const +{ + CHECK_METADATA_READ + return _image->mimeType(); +} + boost::python::list Image::exifKeys() { CHECK_METADATA_READ diff --git a/src/exiv2wrapper.hpp b/src/exiv2wrapper.hpp index 230aba4..f6c305a 100644 --- a/src/exiv2wrapper.hpp +++ b/src/exiv2wrapper.hpp @@ -160,6 +160,9 @@ public: unsigned int pixelWidth() const; unsigned int pixelHeight() const; + // Read-only access to the MIME type of the image. + std::string mimeType() const; + // Read and write access to the EXIF tags. // For a complete list of the available EXIF tags, see // libexiv2's documentation (http://exiv2.org/tags.html). diff --git a/src/exiv2wrapper_python.cpp b/src/exiv2wrapper_python.cpp index 96f9c11..7398194 100644 --- a/src/exiv2wrapper_python.cpp +++ b/src/exiv2wrapper_python.cpp @@ -112,6 +112,8 @@ BOOST_PYTHON_MODULE(libexiv2python) .def("_getPixelWidth", &Image::pixelWidth) .def("_getPixelHeight", &Image::pixelHeight) + .def("_getMimeType", &Image::mimeType) + .def("exifKeys", &Image::exifKeys) .def("getExifTag", &Image::getExifTag) .def("setExifTagValue", &Image::setExifTagValue) diff --git a/src/pyexiv2/metadata.py b/src/pyexiv2/metadata.py index 89d6dcb..7396aff 100644 --- a/src/pyexiv2/metadata.py +++ b/src/pyexiv2/metadata.py @@ -82,6 +82,11 @@ class ImageMetadata(object): return (self._image._getPixelWidth(), self._image._getPixelHeight()) @property + def mime_type(self): + """The mime type of the image.""" + return self._image._getMimeType() + + @property def exif_keys(self): """Keys of the available EXIF tags embedded in the image.""" if self._keys['exif'] is None: |