[mcomix: 5/6] Don't import Image directly and import PIL instead for

Mamoru Tasaka mtasaka at fedoraproject.org
Tue Jan 15 13:54:11 UTC 2013


commit 2ca72a20cd35d90a3318317358401e0d7750bcde
Author: Mamoru Tasaka <tasaka1 at localhost.localdomain>
Date:   Tue Jan 15 22:50:43 2013 +0900

    Don't import Image directly and import PIL instead for
    
      F-19 Pillow conversion
      Patch from Toshio Kuratomi <a.badger at gmail.com>
      (bug 895288)

 mcomix-0.99-import-PIL-for-Image.patch |   87 ++++++++++++++++++++++++++++++++
 mcomix.spec                            |   13 ++++-
 2 files changed, 99 insertions(+), 1 deletions(-)
---
diff --git a/mcomix-0.99-import-PIL-for-Image.patch b/mcomix-0.99-import-PIL-for-Image.patch
new file mode 100644
index 0000000..7b033de
--- /dev/null
+++ b/mcomix-0.99-import-PIL-for-Image.patch
@@ -0,0 +1,87 @@
+Index: mcomix-0.99/mcomix/histogram.py
+===================================================================
+--- mcomix-0.99.orig/mcomix/histogram.py
++++ mcomix-0.99/mcomix/histogram.py
+@@ -1,8 +1,8 @@
+ """histogram.py - Draw histograms (RGB) from pixbufs."""
+ 
+-import Image
+-import ImageDraw
+-import ImageOps
++from PIL import Image
++from PIL import ImageDraw
++from PIL import ImageOps
+ 
+ from mcomix import image_tools
+ 
+Index: mcomix-0.99/mcomix/image_tools.py
+===================================================================
+--- mcomix-0.99.orig/mcomix/image_tools.py
++++ mcomix-0.99/mcomix/image_tools.py
+@@ -6,9 +6,9 @@ import operator
+ import itertools
+ import bisect
+ import gtk
+-import Image
+-import ImageEnhance
+-import ImageOps
++from PIL import Image
++from PIL import ImageEnhance
++from PIL import ImageOps
+ 
+ from mcomix.preferences import prefs
+ 
+Index: mcomix-0.99/mcomix/library/book_area.py
+===================================================================
+--- mcomix-0.99.orig/mcomix/library/book_area.py
++++ mcomix-0.99/mcomix/library/book_area.py
+@@ -4,8 +4,8 @@ import os
+ import urllib
+ import gtk
+ import gobject
+-import Image
+-import ImageDraw
++from PIL import Image
++from PIL import ImageDraw
+ 
+ from mcomix.preferences import prefs
+ from mcomix import thumbnail_view
+Index: mcomix-0.99/mcomix/run.py
+===================================================================
+--- mcomix-0.99.orig/mcomix/run.py
++++ mcomix-0.99/mcomix/run.py
+@@ -138,7 +138,7 @@ except ImportError:
+ 
+ # Check PIL library
+ try:
+-    import Image
++    from PIL import Image
+     assert Image.VERSION >= '1.1.5'
+ 
+ except AssertionError:
+Index: mcomix-0.99/mcomix/thumbnail_tools.py
+===================================================================
+--- mcomix-0.99.orig/mcomix/thumbnail_tools.py
++++ mcomix-0.99/mcomix/thumbnail_tools.py
+@@ -9,7 +9,7 @@ import tempfile
+ import mimetypes
+ import threading
+ import itertools
+-import Image
++from PIL import Image
+ from urllib import pathname2url
+ 
+ try:  # The md5 module is deprecated as of Python 2.5, replaced by hashlib.
+Index: mcomix-0.99/mime/comicthumb
+===================================================================
+--- mcomix-0.99.orig/mime/comicthumb
++++ mcomix-0.99/mime/comicthumb
+@@ -22,7 +22,7 @@ import tarfile
+ import subprocess
+ 
+ try:
+-    import Image
++    from PIL import Image
+ except ImportError:
+     print '! Could not import the Image module (PIL).'
+     print __doc__
diff --git a/mcomix.spec b/mcomix.spec
index 0b1543d..0320e2b 100644
--- a/mcomix.spec
+++ b/mcomix.spec
@@ -1,6 +1,6 @@
 Name:		mcomix
 Version:	0.99
-Release:	2%{?dist}
+Release:	3%{?dist}
 Summary:	User-friendly, customizable image viewer for comic books
 
 Group:		Amusements/Graphics
@@ -13,6 +13,10 @@ Source0:	http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2
 Patch0:		mcomix-0.92-fedora-rpmbuild-gtk.patch
 # Fedora specific(?): patch to search default localedir for gettext files
 Patch1:		mcomix-0.98-gettext-system-install.patch
+# Don't import Image directory and import PIL instead for
+# F-19 Pillow conversion
+# (bug 895288)
+Patch2:		mcomix-0.99-import-PIL-for-Image.patch
 
 BuildArch:	noarch
 BuildRequires:	gettext
@@ -39,6 +43,7 @@ is written in Python and uses GTK+ through the PyGTK bindings.
 %setup -q
 %patch0 -p1 -b .rpmbuild
 %patch1 -p1 -b .gettext
+%patch2 -p1 -b .pil
 
 %build
 # save timestamps
@@ -158,6 +163,12 @@ exit 0
 
 
 %changelog
+* Tue Jan 15 2013 Mamoru TASAKA <mtasaka at fedoraproject.org> - 0.99-3
+- Don't import Image directly and import PIL instead for
+  F-19 Pillow conversion
+  Patch from Toshio Kuratomi <a.badger at gmail.com>
+  (bug 895288)
+
 * Thu Jul 19 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.99-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
 


More information about the scm-commits mailing list