[phatch/f14] Fix bug 704703 modified: phatch.spec modified: pyexiv2_compat.patch
Lakshmi Narasimhan T V
narasim at fedoraproject.org
Sat Jun 25 10:02:55 UTC 2011
commit 25a65c1d894fac3921232efaff2d1cfe75ea3a4e
Author: Lakshmi Narasimhan <lakshminaras2002 at gmail.com>
Date: Sat Jun 25 15:31:56 2011 +0530
Fix bug 704703
modified: phatch.spec
modified: pyexiv2_compat.patch
phatch.spec | 5 +++-
pyexiv2_compat.patch | 56 ++++++++++++++++++++++++++++++++++++++++++-------
2 files changed, 52 insertions(+), 9 deletions(-)
---
diff --git a/phatch.spec b/phatch.spec
index ff170c4..15d9e51 100644
--- a/phatch.spec
+++ b/phatch.spec
@@ -2,7 +2,7 @@
%define debug_package %{nil}
Name: phatch
Version: 0.2.7
-Release: 5%{?dist}
+Release: 6%{?dist}
Summary: Photo batch processor
Group: Applications/Multimedia
License: GPLv3+
@@ -143,6 +143,9 @@ rm -rf $RPM_BUILD_ROOT
%{python_sitelib}/%{name}/lib/linux/nautilusExtension.*
%changelog
+* Sat Jun 25 2011 Lakshmi Narasimhan T V <lakshminaras2002 at gmail.com> - 0.2.7-6
+- Fix pyexiv2 compatibility issue #704703. Updated the patch pyexiv2_compat.patch
+
* Thu Jun 23 2011 Lakshmi Narasimhan T V <lakshminaras2002 at gmail.com> - 0.2.7-5
- Fix pyexiv2 compatibility issue #704703. Applied patch pyexiv2_compat.patch
diff --git a/pyexiv2_compat.patch b/pyexiv2_compat.patch
index e90df34..c7a3047 100644
--- a/pyexiv2_compat.patch
+++ b/pyexiv2_compat.patch
@@ -1,6 +1,6 @@
diff -ur phatch-0.2.7_old/phatch/core/pil.py phatch-0.2.7/phatch/core/pil.py
--- phatch-0.2.7_old/phatch/core/pil.py 2010-03-12 12:29:26.000000000 +0530
-+++ phatch-0.2.7/phatch/core/pil.py 2011-06-24 21:02:06.564751310 +0530
++++ phatch-0.2.7/phatch/core/pil.py 2011-06-25 14:27:36.487002576 +0530
@@ -180,8 +180,8 @@
metadata.InfoZexif: image}
#check format -> readable/writable metadata with pyexiv2
@@ -28,7 +28,7 @@ diff -ur phatch-0.2.7_old/phatch/lib/imageTable.py phatch-0.2.7/phatch/lib/image
if value:
diff -ur phatch-0.2.7_old/phatch/lib/metadata.py phatch-0.2.7/phatch/lib/metadata.py
--- phatch-0.2.7_old/phatch/lib/metadata.py 2010-03-12 12:29:26.000000000 +0530
-+++ phatch-0.2.7/phatch/lib/metadata.py 2011-06-24 21:01:51.829423501 +0530
++++ phatch-0.2.7/phatch/lib/metadata.py 2011-06-25 14:29:13.460944234 +0530
@@ -931,8 +931,8 @@
"""
format = imtools.get_format(os.path.splitext(filename)[-1][1:])
@@ -74,7 +74,7 @@ diff -ur phatch-0.2.7_old/phatch/lib/openImage.py phatch-0.2.7/phatch/lib/openIm
return imtools.open_image_data(thumb_data)
diff -ur phatch-0.2.7_old/phatch/lib/_pyexiv2.py phatch-0.2.7/phatch/lib/_pyexiv2.py
--- phatch-0.2.7_old/phatch/lib/_pyexiv2.py 2010-03-12 12:29:26.000000000 +0530
-+++ phatch-0.2.7/phatch/lib/_pyexiv2.py 2011-06-24 23:01:24.927289904 +0530
++++ phatch-0.2.7/phatch/lib/_pyexiv2.py 2011-06-25 13:45:49.054578121 +0530
@@ -103,8 +103,7 @@
#verify if there are tags which might break exiv2
broken_tag = None
@@ -85,7 +85,7 @@ diff -ur phatch-0.2.7_old/phatch/lib/_pyexiv2.py phatch-0.2.7/phatch/lib/_pyexiv
if RE_BROKEN.match(tag):
broken_tag = RE_BROKEN
break
-@@ -147,21 +146,22 @@
+@@ -147,21 +146,25 @@
:type thumbdata: string
"""
#read target
@@ -95,6 +95,7 @@ diff -ur phatch-0.2.7_old/phatch/lib/_pyexiv2.py phatch-0.2.7/phatch/lib/_pyexiv
+ target.read()
warnings = []
written = False
++ #print broken_tag
#copy exif metadata
if (not source_format or source_format in READ_EXIF) and \
(not target_format or target_format in WRITE_EXIF):
@@ -109,11 +110,13 @@ diff -ur phatch-0.2.7_old/phatch/lib/_pyexiv2.py phatch-0.2.7/phatch/lib/_pyexiv
- source_pyexiv2_image._Image__getExifTag(tag)[1])
+ #target._Image__setExifTag(tag,
+ # source_pyexiv2_image._Image__getExifTag(tag)[1])
-+ target[tag] = source_pyexiv2_image[tag].raw_value
++ #targetMessage = '%s %s' % (tag, source_pyexiv2_image[tag].raw_value)
++ #print targetMessage
++ target[tag] = pyexiv2.ExifTag(tag,source_pyexiv2_image[tag].value);
written = True
except Exception, message:
message = '%s: %s' % (tag, message)
-@@ -169,9 +169,9 @@
+@@ -169,9 +172,9 @@
#copy iptc metadata
if (not source_format or source_format in READ_IPTC) and \
(not target_format or target_format in WRITE_IPTC):
@@ -121,11 +124,19 @@ diff -ur phatch-0.2.7_old/phatch/lib/_pyexiv2.py phatch-0.2.7/phatch/lib/_pyexiv
+ for tag in source_pyexiv2_image.iptc_keys:
try:
- target[tag] = source_pyexiv2_image[tag]
-+ target[tag] = source_pyexiv2_image[tag].raw_value
++ target[tag] = pyexiv2.IptcTag(tag, source_pyexiv2_image[tag].value);
written = True
except Exception, message:
message = '%s: %s' % (tag, message)
-@@ -187,7 +187,7 @@
+@@ -180,14 +183,14 @@
+ if (not source_format or source_format in READ_COMMENT) and \
+ (not target_format or target_format in WRITE_COMMENT):
+ try:
+- target.setComment(source_pyexiv2_image.getComment())
++ target.comment = (source_pyexiv2_image.comment)
+ written = True
+ except Exception, message:
+ warnings.append(message)
warnings.append(write_thumbdata(target, thumbdata))
#save metadata (this might rise an exception)
if written:
@@ -134,6 +145,35 @@ diff -ur phatch-0.2.7_old/phatch/lib/_pyexiv2.py phatch-0.2.7/phatch/lib/_pyexiv
return '\n'.join(warnings)
+@@ -200,6 +203,8 @@
+ return format
+
+
++# This method won't work. There is no method in pyexiv2 metadata
++# called getThumbnailData.
+ def read_thumbdata(image):
+ try:
+ return image.getThumbnailData()
+@@ -211,7 +216,9 @@
+ if (thumbdata is None):
+ return ''
+ try:
+- image.setThumbnailData(thumbdata)
++ #print "setting thumbdata"
++ image.exif_thumbnail.data = thumbdata
++ #image.setThumbnailData(thumbdata)
+ return ''
+ except Exception, message:
+ return unicode(message)
+@@ -234,7 +241,7 @@
+ def flush(image, thumbdata):
+ warnings = [write_thumbdata(image, thumbdata)]
+ try:
+- image.writeMetadata()
++ image.write()
+ except Exception, message:
+ warnings.append(unicode(message))
+ return '\n'.join(warnings)
diff -ur phatch-0.2.7_old/tests/test_suite/utils.py phatch-0.2.7/tests/test_suite/utils.py
--- phatch-0.2.7_old/tests/test_suite/utils.py 2010-03-12 12:29:26.000000000 +0530
+++ phatch-0.2.7/tests/test_suite/utils.py 2011-06-24 21:01:51.834424631 +0530
More information about the scm-commits
mailing list