Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.5:Update
python-ExifRead
merged_pr_58.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File merged_pr_58.patch of Package python-ExifRead
From fba43abc5d0eea1c73ca23f85f6c93cb167cb754 Mon Sep 17 00:00:00 2001 From: Simone Camporeale <simone.camporeale@netgrid.it> Date: Wed, 7 Oct 2015 12:14:32 +0200 Subject: [PATCH 1/7] Fix unicode issues --- exifread/classes.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/exifread/classes.py b/exifread/classes.py index 91d6b93..9df3cbe 100644 --- a/exifread/classes.py +++ b/exifread/classes.py @@ -224,16 +224,21 @@ def dump_ifd(self, ifd, ifd_name, tag_dict=EXIF_TAGS, relative=0, stop_tag=DEFAU offset = offset + type_length # now 'values' is either a string or an array + encoded_values = None if count == 1 and field_type != 2: - printable = str(values[0]) + encoded_values = values[0] elif count > 50 and len(values) > 20: - printable = str(values[0:20])[0:-1] + ", ... ]" + encoded_values = [] + encoded_values[:0] = values[0:20] + encoded_values[:20] = ',...' else: - try: - printable = str(values) - # fix for python2's handling of unicode values - except UnicodeEncodeError: - printable = unicode(values) + encoded_values = values + + try: + printable = str(encoded_values) + # fix for python2's handling of unicode values + except UnicodeEncodeError: + printable = unicode(values) # compute printable version of values if tag_entry: From 9d3a19ef230589d8af3d3b28763cb78126d4995e Mon Sep 17 00:00:00 2001 From: Simone Camporeale <simone.camporeale@netgrid.it> Date: Wed, 7 Oct 2015 12:23:11 +0200 Subject: [PATCH 2/7] Fixed string format. --- exifread/classes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exifread/classes.py b/exifread/classes.py index 9df3cbe..713f7b7 100644 --- a/exifread/classes.py +++ b/exifread/classes.py @@ -230,7 +230,7 @@ def dump_ifd(self, ifd, ifd_name, tag_dict=EXIF_TAGS, relative=0, stop_tag=DEFAU elif count > 50 and len(values) > 20: encoded_values = [] encoded_values[:0] = values[0:20] - encoded_values[:20] = ',...' + encoded_values[:20] = ', ... ]' else: encoded_values = values From 065bf2689407d840b49fff0ba41809a36a3096d2 Mon Sep 17 00:00:00 2001 From: Simone Camporeale <simone.camporeale@netgrid.it> Date: Thu, 8 Oct 2015 08:46:17 +0200 Subject: [PATCH 3/7] Fixed an error in string appending --- exifread/classes.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exifread/classes.py b/exifread/classes.py index 713f7b7..cc98ca7 100644 --- a/exifread/classes.py +++ b/exifread/classes.py @@ -230,7 +230,8 @@ def dump_ifd(self, ifd, ifd_name, tag_dict=EXIF_TAGS, relative=0, stop_tag=DEFAU elif count > 50 and len(values) > 20: encoded_values = [] encoded_values[:0] = values[0:20] - encoded_values[:20] = ', ... ]' + encoded_values[20:] = ', ... ]' + encoded_values = ''.join(encoded_values) else: encoded_values = values From c9ff961dc99d53ba1b6b53e2214fb255e003519b Mon Sep 17 00:00:00 2001 From: Simone Camporeale <simone.camporeale@netgrid.it> Date: Mon, 19 Oct 2015 17:54:45 +0200 Subject: [PATCH 4/7] Fixed issue in data format --- exifread/classes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exifread/classes.py b/exifread/classes.py index cc98ca7..b1d2ddf 100644 --- a/exifread/classes.py +++ b/exifread/classes.py @@ -231,7 +231,7 @@ def dump_ifd(self, ifd, ifd_name, tag_dict=EXIF_TAGS, relative=0, stop_tag=DEFAU encoded_values = [] encoded_values[:0] = values[0:20] encoded_values[20:] = ', ... ]' - encoded_values = ''.join(encoded_values) + encoded_values = ''.join(chr(encoded_values)) else: encoded_values = values From 897ee14e94bba19a9f1acbd1cba1c244856be9c6 Mon Sep 17 00:00:00 2001 From: Simone Camporeale <simone.camporeale@netgrid.it> Date: Mon, 19 Oct 2015 19:35:34 +0200 Subject: [PATCH 5/7] Added a check to handle string in correct branch --- exifread/classes.py | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/exifread/classes.py b/exifread/classes.py index b1d2ddf..ad538d4 100644 --- a/exifread/classes.py +++ b/exifread/classes.py @@ -224,22 +224,15 @@ def dump_ifd(self, ifd, ifd_name, tag_dict=EXIF_TAGS, relative=0, stop_tag=DEFAU offset = offset + type_length # now 'values' is either a string or an array - encoded_values = None if count == 1 and field_type != 2: - encoded_values = values[0] - elif count > 50 and len(values) > 20: - encoded_values = [] - encoded_values[:0] = values[0:20] - encoded_values[20:] = ', ... ]' - encoded_values = ''.join(chr(encoded_values)) + printable = str(values[0]) + elif count > 50 and len(values) > 20 and not isinstance(values, basestring) : + printable = str(values[0:20])[0:-1] + ", ... ]" else: - encoded_values = values - - try: - printable = str(encoded_values) - # fix for python2's handling of unicode values - except UnicodeEncodeError: - printable = unicode(values) + try: + printable = str(values) + except: + printable = unicode(values) # compute printable version of values if tag_entry: From 1dda7c2caf4d78f34bf1333ecd5f3daf0e215a0e Mon Sep 17 00:00:00 2001 From: Simone Camporeale <simone.camporeale@netgrid.it> Date: Mon, 19 Oct 2015 19:41:58 +0200 Subject: [PATCH 6/7] Indent Error --- exifread/classes.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/exifread/classes.py b/exifread/classes.py index ad538d4..10f405c 100644 --- a/exifread/classes.py +++ b/exifread/classes.py @@ -229,11 +229,10 @@ def dump_ifd(self, ifd, ifd_name, tag_dict=EXIF_TAGS, relative=0, stop_tag=DEFAU elif count > 50 and len(values) > 20 and not isinstance(values, basestring) : printable = str(values[0:20])[0:-1] + ", ... ]" else: - try: - printable = str(values) - except: - printable = unicode(values) - + try: + printable = str(values) + except UnicodeEncodeError: + printable = unicode(values) # compute printable version of values if tag_entry: # optional 2nd tag element is present From 89441161356f48aa35731ef291bd1136fa8cc4e3 Mon Sep 17 00:00:00 2001 From: Simone Camporeale <simone.camporeale@netgrid.it> Date: Mon, 19 Oct 2015 19:45:29 +0200 Subject: [PATCH 7/7] Python V3 compatibility --- exifread/classes.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/exifread/classes.py b/exifread/classes.py index 10f405c..7880dc9 100644 --- a/exifread/classes.py +++ b/exifread/classes.py @@ -7,6 +7,10 @@ logger = get_logger() +try: + basestring +except NameError: + basestring = str class IfdTag: """
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor