Support pillow and imaging

Bug #1118574 reported by Tom "spot" Callaway
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Gwibber
New
Undecided
Unassigned

Bug Description

Python has two PIL provides, python-imaging and python-pillow. Fedora is moving to python-pillow in the next release.

imaging supports being loaded by doing:

import Image

or

from PIL import Image

pillow only supports the latter, so we're patching all the calls to use 'from PIL import image'

Please apply the below changes! (They're against 3.4.2, but the code hasn't changed in any real way.)

Index: gwibber-3.4.2/gwibber/microblog/util/imagehandler.py
===================================================================
--- gwibber-3.4.2.orig/gwibber/microblog/util/imagehandler.py
+++ gwibber-3.4.2/gwibber/microblog/util/imagehandler.py
@@ -1,6 +1,7 @@
 #!/usr/bin/env python

-import os, hashlib, urllib2, Image
+import os, hashlib, urllib2
+from PIL import Image

 DEFAULT_AVATAR = 'http://digg.com/img/udl.png'

Index: gwibber-3.4.2/gwibber/microblog/util/resources.py
===================================================================
--- gwibber-3.4.2.orig/gwibber/microblog/util/resources.py
+++ gwibber-3.4.2/gwibber/microblog/util/resources.py
@@ -8,7 +8,7 @@ import os, sys
 from hashlib import sha1
 from os import makedirs, remove, environ
 from os.path import join, isdir, realpath, exists
-import Image
+from PIL import Image
 import mx.DateTime
 from gwibber.microblog import network
 from gwibber.microblog.util.const import *

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.