Hello community,

here is the log from the commit of package python-exiv2 for openSUSE:Factory 
checked in at 2018-06-28 15:14:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-exiv2 (Old)
 and      /work/SRC/openSUSE:Factory/.python-exiv2.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-exiv2"

Thu Jun 28 15:14:58 2018 rev:2 rq:619553 version:0.3.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-exiv2/python-exiv2.changes        
2018-05-11 14:28:02.096615498 +0200
+++ /work/SRC/openSUSE:Factory/.python-exiv2.new/python-exiv2.changes   
2018-06-28 15:15:02.275414928 +0200
@@ -1,0 +2,6 @@
+Thu Jun 28 09:38:11 UTC 2018 - [email protected]
+
+- Update to version 0.3.0
+  * Add some convenient functions
+
+-------------------------------------------------------------------

Old:
----
  py3exiv2-0.2.1.tar.gz

New:
----
  py3exiv2-0.3.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-exiv2.spec ++++++
--- /var/tmp/diff_new_pack.tdBLxE/_old  2018-06-28 15:15:03.947411866 +0200
+++ /var/tmp/diff_new_pack.tdBLxE/_new  2018-06-28 15:15:03.947411866 +0200
@@ -1,5 +1,5 @@
 #
-# spec file for package python-py3exiv2
+# spec file for package python-exiv2
 #
 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -13,6 +13,7 @@
 # published by the Open Source Initiative.
 
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
+#
 
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
@@ -21,21 +22,21 @@
 %define         skip_python2 1
 
 Name:           python-exiv2
-Version:        0.2.1
+Version:        0.3.0
 Release:        0
-License:        GPL-3.0
 Summary:        Python3 bindings for the exiv2 library
-Url:            https://launchpad.net/py3exiv2
+License:        GPL-3.0-only
 Group:          Development/Languages/Python
+Url:            https://launchpad.net/py3exiv2
 Source:         
https://files.pythonhosted.org/packages/source/p/py3exiv2/py3exiv2-%{version}.tar.gz
 
-BuildRequires:  libboost_python3-devel
-BuildRequires:  libexiv2-devel
-BuildRequires:  gcc-c++
-BuildRequires:  python-rpm-macros
 BuildRequires:  %{python_module devel}
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
+BuildRequires:  gcc-c++
+BuildRequires:  libboost_python3-devel
+BuildRequires:  libexiv2-devel
+BuildRequires:  python-rpm-macros
 
 %python_subpackages
 

++++++ py3exiv2-0.2.1.tar.gz -> py3exiv2-0.3.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/py3exiv2-0.2.1/PKG-INFO new/py3exiv2-0.3.0/PKG-INFO
--- old/py3exiv2-0.2.1/PKG-INFO 2016-08-17 04:53:33.000000000 +0200
+++ new/py3exiv2-0.3.0/PKG-INFO 2018-05-15 12:57:16.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: py3exiv2
-Version: 0.2.1
+Version: 0.3.0
 Summary: A Python3 binding to the library exiv2
 Home-page: https://launchpad.net/py3exiv2
 Author: Vincent Vande Vyvre
@@ -39,6 +39,8 @@
 Classifier: Topic :: Software Development
 Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
 Classifier: Programming Language :: C++
-Classifier: Programming Language :: Python :: 3.2
 Classifier: Programming Language :: Python :: 3.3
 Classifier: Programming Language :: Python :: 3.4
+Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/py3exiv2-0.2.1/README new/py3exiv2-0.3.0/README
--- old/py3exiv2-0.2.1/README   2015-02-04 23:13:05.000000000 +0100
+++ new/py3exiv2-0.3.0/README   2018-05-15 11:11:47.000000000 +0200
@@ -72,7 +72,7 @@
 =======
 
 Copyright (C) 2006-2011 Olivier Tilloy <[email protected]>
-Copyright (C) 2015 Vincent Vande Vyvre <[email protected]>
+Copyright (C) 2015-2018 Vincent Vande Vyvre <[email protected]>
 
 py3exiv2 is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License version 3 as published by the Free
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/py3exiv2-0.2.1/setup.cfg new/py3exiv2-0.3.0/setup.cfg
--- old/py3exiv2-0.2.1/setup.cfg        2016-08-17 04:53:33.000000000 +0200
+++ new/py3exiv2-0.3.0/setup.cfg        2018-05-15 12:57:16.000000000 +0200
@@ -1,5 +1,5 @@
 [egg_info]
 tag_svn_revision = 0
-tag_date = 0
 tag_build = 
+tag_date = 0
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/py3exiv2-0.2.1/setup.py new/py3exiv2-0.3.0/setup.py
--- old/py3exiv2-0.2.1/setup.py 2016-08-17 04:52:10.000000000 +0200
+++ new/py3exiv2-0.3.0/setup.py 2018-05-15 11:16:06.000000000 +0200
@@ -36,14 +36,14 @@
             if '.so' in l:
                 l = l.split('.so')[0]
                 # Assume there's no longer python2.3 in the wild
-                if '3' in l[2:]:
+                if '3' in l[-2:]:
                     return l.replace('libboost', 'boost')
 
 libboost = get_libboost_name()
 
 setup(
     name='py3exiv2',
-    version='0.2.1',
+    version='0.3.0',
     description='A Python3 binding to the library exiv2',
     long_description=long_description,
     url='https://launchpad.net/py3exiv2',
@@ -58,9 +58,11 @@
         'Topic :: Software Development',
         'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
         'Programming Language :: C++',
-        'Programming Language :: Python :: 3.2',
         'Programming Language :: Python :: 3.3',
         'Programming Language :: Python :: 3.4',
+        'Programming Language :: Python :: 3.5',
+        'Programming Language :: Python :: 3.6',
+        'Programming Language :: Python :: 3.7',
     ],
     keywords='exiv2 pyexiv2 EXIF IPTC XMP image metadata',
     packages = find_packages('src'),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/py3exiv2-0.2.1/src/exiv2wrapper.cpp 
new/py3exiv2-0.3.0/src/exiv2wrapper.cpp
--- old/py3exiv2-0.2.1/src/exiv2wrapper.cpp     2016-08-12 08:24:10.000000000 
+0200
+++ new/py3exiv2-0.3.0/src/exiv2wrapper.cpp     2018-05-15 08:43:21.000000000 
+0200
@@ -1,7 +1,7 @@
 // 
*****************************************************************************
 /*
  * Copyright (C) 2006-2012 Olivier Tilloy <[email protected]>
- * Copyright (C) 2015-2016 Vincent Vande Vyvre <[email protected]>
+ * Copyright (C) 2015-2019 Vincent Vande Vyvre <[email protected]>
  *
  * This file is part of the pyexiv2 distribution.
  *
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/py3exiv2-0.2.1/src/exiv2wrapper.hpp 
new/py3exiv2-0.3.0/src/exiv2wrapper.hpp
--- old/py3exiv2-0.2.1/src/exiv2wrapper.hpp     2016-08-12 08:36:08.000000000 
+0200
+++ new/py3exiv2-0.3.0/src/exiv2wrapper.hpp     2018-05-15 08:43:02.000000000 
+0200
@@ -1,7 +1,7 @@
 // 
*****************************************************************************
 /*
  * Copyright (C) 2006-2010 Olivier Tilloy <[email protected]>
- * Copyright (C) 2015-2016 Vincent Vande Vyvre <[email protected]>
+ * Copyright (C) 2015-2018 Vincent Vande Vyvre <[email protected]>
  *
  * This file is part of the py3exiv2 distribution.
  *
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/py3exiv2-0.2.1/src/exiv2wrapper_python.cpp 
new/py3exiv2-0.3.0/src/exiv2wrapper_python.cpp
--- old/py3exiv2-0.2.1/src/exiv2wrapper_python.cpp      2016-08-12 
08:37:53.000000000 +0200
+++ new/py3exiv2-0.3.0/src/exiv2wrapper_python.cpp      2018-05-15 
08:44:07.000000000 +0200
@@ -1,7 +1,7 @@
 // 
*****************************************************************************
 /*
  * Copyright (C) 2006-2012 Olivier Tilloy <[email protected]>
- * Copyright (C) 2015-2016 Vincent Vande Vyvre <[email protected]>
+ * Copyright (C) 2015-2018 Vincent Vande Vyvre <[email protected]>
  *
  * This file is part of the pyexiv2 distribution.
  *
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/py3exiv2-0.2.1/src/py3exiv2.egg-info/PKG-INFO 
new/py3exiv2-0.3.0/src/py3exiv2.egg-info/PKG-INFO
--- old/py3exiv2-0.2.1/src/py3exiv2.egg-info/PKG-INFO   2016-08-17 
04:53:30.000000000 +0200
+++ new/py3exiv2-0.3.0/src/py3exiv2.egg-info/PKG-INFO   2018-05-15 
12:57:16.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: py3exiv2
-Version: 0.2.1
+Version: 0.3.0
 Summary: A Python3 binding to the library exiv2
 Home-page: https://launchpad.net/py3exiv2
 Author: Vincent Vande Vyvre
@@ -39,6 +39,8 @@
 Classifier: Topic :: Software Development
 Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
 Classifier: Programming Language :: C++
-Classifier: Programming Language :: Python :: 3.2
 Classifier: Programming Language :: Python :: 3.3
 Classifier: Programming Language :: Python :: 3.4
+Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/py3exiv2-0.2.1/src/pyexiv2/__init__.py 
new/py3exiv2-0.3.0/src/pyexiv2/__init__.py
--- old/py3exiv2-0.2.1/src/pyexiv2/__init__.py  2016-08-12 08:59:24.000000000 
+0200
+++ new/py3exiv2-0.3.0/src/pyexiv2/__init__.py  2018-05-15 08:49:05.000000000 
+0200
@@ -3,7 +3,7 @@
 # 
******************************************************************************
 #
 # Copyright (C) 2006-2011 Olivier Tilloy <[email protected]>
-# Copyright (C) 2015-2016 Vincent Vande Vyvre <[email protected]>
+# Copyright (C) 2015-2018 Vincent Vande Vyvre <[email protected]>
 #
 # This file is part of the py3exiv2 distribution.
 #
@@ -75,7 +75,7 @@
 
 
 #: A tuple containing the three components of the version number: major, 
minor, micro.
-version_info = (0, 2, 0)
+version_info = (0, 3, 0)
 
 #: The version of the module as a string (major.minor.micro).
 __version__ = _make_version(version_info)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/py3exiv2-0.2.1/src/pyexiv2/exif.py 
new/py3exiv2-0.3.0/src/pyexiv2/exif.py
--- old/py3exiv2-0.2.1/src/pyexiv2/exif.py      2016-08-12 09:07:45.000000000 
+0200
+++ new/py3exiv2-0.3.0/src/pyexiv2/exif.py      2018-02-02 14:19:27.000000000 
+0100
@@ -3,7 +3,7 @@
 # 
******************************************************************************
 #
 # Copyright (C) 2006-2011 Olivier Tilloy <[email protected]>
-# Copyright (C) 2015-2016 Vincent Vande Vyvre <[email protected]>
+# Copyright (C) 2015-2018 Vincent Vande Vyvre <[email protected]>
 #
 # This file is part of the py3exiv2 distribution.
 #
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/py3exiv2-0.2.1/src/pyexiv2/iptc.py 
new/py3exiv2-0.3.0/src/pyexiv2/iptc.py
--- old/py3exiv2-0.2.1/src/pyexiv2/iptc.py      2016-08-12 09:15:21.000000000 
+0200
+++ new/py3exiv2-0.3.0/src/pyexiv2/iptc.py      2018-02-02 14:29:01.000000000 
+0100
@@ -3,7 +3,7 @@
 # 
******************************************************************************
 #
 # Copyright (C) 2006-2011 Olivier Tilloy <[email protected]>
-# Copyright (C) 2015-2016 Vincent Vande Vyvre <[email protected]>
+# Copyright (C) 2015-2018 Vincent Vande Vyvre <[email protected]>
 #
 # This file is part of the py3exiv2 distribution.
 #
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/py3exiv2-0.2.1/src/pyexiv2/metadata.py 
new/py3exiv2-0.3.0/src/pyexiv2/metadata.py
--- old/py3exiv2-0.2.1/src/pyexiv2/metadata.py  2016-08-12 09:21:40.000000000 
+0200
+++ new/py3exiv2-0.3.0/src/pyexiv2/metadata.py  2018-05-15 09:05:09.000000000 
+0200
@@ -3,7 +3,7 @@
 # 
******************************************************************************
 #
 # Copyright (C) 2006-2011 Olivier Tilloy <[email protected]>
-# Copyright (C) 2015-2016 Vincent Vande Vyvre <[email protected]>
+# Copyright (C) 2015-2018 Vincent Vande Vyvre <[email protected]>
 #
 # This file is part of the py3exiv2 distribution.
 #
@@ -524,7 +524,130 @@
         except KeyError:
             pass
 
-    iptc_charset = property(fget=_get_iptc_charset, fset=_set_iptc_charset,
+    iptc_charset = property(fget=_get_iptc_charset, 
+                            fset=_set_iptc_charset,
                             fdel=_del_iptc_charset,
-                            doc='An optional character set the IPTC data is 
encoded in.')
+                            doc='An optional character set the IPTC data'\
+                                ' is encoded in.')
+
+    # Some convenient functions -------------------------------------------
+    def get_iso(self):
+        """Returns the ISO value as integer.
+
+        """
+        try:
+            return self["Exif.Photo.ISOSpeedRatings"].value
+        except KeyError:
+            return
+
+    def get_shutter_speed(self, float_=False):
+        """Returns the exposure time as rational or float.
+
+        Args:
+        float_ -- if False, default, the value is returned as rational 
+                  otherwise as float
+        """
+        try:
+            speed = self['Exif.Photo.ExposureTime'].value 
+        except KeyError:
+            return
+
+        if float_:
+            if speed.denominator:
+                return speed.numerator / speed.denominator
+            return float(numerator)
+
+        return speed
+
+    def get_focal_length(self):
+        """Returns the focal length as float.
+
+        """
+        try:
+            focal = self['Exif.Photo.FocalLength'].value
+            if focal.denominator:
+                return round(focal.numerator / focal.denominator, 2)
+
+            else:
+                return float(focal.numerator)
+
+        except KeyError:
+            return
+
+    def get_aperture(self):
+        """Returns the fNumber as float.
+
+        """
+        try:
+            fnumber = self["Exif.Photo.FNumber"].value
+            if fnumber.denominator:
+                return round(fnumber.numerator / fnumber.denominator, 2)
+
+            else:
+                return float(fnumber.numerator)
+        except KeyError:
+            return
+
+    def get_orientation(self):
+        """Returns the orientation of the image as integer.
+
+        If the tag is not set, the value 1 is returned.
+        """
+        try:
+            return self["Exif.Image.Orientation"].value
+        except KeyError:
+            return 1
+
+    def get_exposure_data(self, float_=False):
+        """Returns the exposure parameters of the image.
+
+        The values are returned as a dict which contains:
+            "iso": the ISO value
+            "speed": the exposure time
+            "focal": the focal length
+            "aperture": the fNumber
+            "orientation": the orientation of the image
+
+        When a tag is not set, the value will be None
+
+        Args:
+        float_ -- if False, default, the value of the exposure time is 
returned 
+                  as rational otherwise as float
+        """
+        data = {"iso": self.get_iso(),
+                "speed": self.get_shutter_speed(float_),
+                "focal": self.get_focal_length(),
+                "aperture": self.get_aperture(),
+                "orientation": self.get_orientation()}
+
+        return data
+
+    def get_rights_data(self):
+        """Returns the author and copyright info.
+
+        The values are returned as a dict which contains:
+            "creator": the value of Xmp.dc.creator
+            "artist": the value of Exif.Image.Artist
+            "rights": the value of Xmp.dc.rights
+            "copyright": the value of Exif.Image.Copyright
+            "marked": the value of Xmp.xmpRights.Marked
+            "usage": the value of Xmp.xmpRights.UsageTerms
+
+        When a tag is not set, the value will be None
+        """
+        tags = [('creator', 'Xmp.dc.creator'), 
+                ('artist', 'Exif.Image.Artist'),
+                ('rights', 'Xmp.dc.rights'), 
+                ('copyright', 'Exif.Image.Copyright'),
+                ('marked', 'Xmp.xmpRights.Marked'), 
+                ('usage', 'Xmp.xmpRights.UsageTerms')]
+        rights = {}
+        for tag in tags:
+            try:
+                rights[tag[0]] = self[tag[1]].value
+            except KeyError:
+                rights[tag[0]] = None
+
+        return rights
+
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/py3exiv2-0.2.1/src/pyexiv2/preview.py 
new/py3exiv2-0.3.0/src/pyexiv2/preview.py
--- old/py3exiv2-0.2.1/src/pyexiv2/preview.py   2016-08-11 08:27:23.000000000 
+0200
+++ new/py3exiv2-0.3.0/src/pyexiv2/preview.py   2018-02-02 14:38:54.000000000 
+0100
@@ -3,7 +3,7 @@
 # 
******************************************************************************
 #
 # Copyright (C) 2010 Olivier Tilloy <[email protected]>
-# Copyright (C) 2015-2016 Vincent Vande Vyvre <[email protected]>
+# Copyright (C) 2015-2018 Vincent Vande Vyvre <[email protected]>
 #
 # This file is part of the py3exiv2 distribution.
 #
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/py3exiv2-0.2.1/src/pyexiv2/utils.py 
new/py3exiv2-0.3.0/src/pyexiv2/utils.py
--- old/py3exiv2-0.2.1/src/pyexiv2/utils.py     2016-08-12 10:46:55.000000000 
+0200
+++ new/py3exiv2-0.3.0/src/pyexiv2/utils.py     2018-02-02 15:26:42.000000000 
+0100
@@ -3,7 +3,7 @@
 # 
******************************************************************************
 #
 # Copyright (C) 2006-2012 Olivier Tilloy <[email protected]>
-# Copyright (C) 2015-2016 Vincent Vande Vyvre <[email protected]>
+# Copyright (C) 2015-2018 Vincent Vande Vyvre <[email protected]>
 #
 # This file is part of the py3exiv2 distribution.
 #
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/py3exiv2-0.2.1/src/pyexiv2/xmp.py 
new/py3exiv2-0.3.0/src/pyexiv2/xmp.py
--- old/py3exiv2-0.2.1/src/pyexiv2/xmp.py       2016-08-12 12:36:15.000000000 
+0200
+++ new/py3exiv2-0.3.0/src/pyexiv2/xmp.py       2018-05-15 08:52:04.000000000 
+0200
@@ -3,7 +3,7 @@
 # 
******************************************************************************
 #
 # Copyright (C) 2006-2011 Olivier Tilloy <[email protected]>
-# Copyright (C) 2015-2016 Vincent Vande Vyvre <[email protected]>
+# Copyright (C) 2015-2018 Vincent Vande Vyvre <[email protected]>
 #
 # This file is part of the py3exiv2 distribution.
 #
@@ -30,8 +30,8 @@
 
 import libexiv2python
 
-from pyexiv2.utils import FixedOffset, is_fraction, make_fraction, \
-                          GPSCoordinate, DateTimeFormatter
+from pyexiv2.utils import (FixedOffset, is_fraction, make_fraction,
+                          GPSCoordinate, DateTimeFormatter)
 
 import datetime
 import re


Reply via email to