Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 675944 Details for
Bug 893804
F19 moving from python-PIL to python-pillow. Small patch needed
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch to use the form of import of PIL that is pillow compatible
bkchem-pillow.patch (text/plain), 6.31 KB, created by
Toshio Ernie Kuratomi
on 2013-01-09 23:42:08 UTC
(
hide
)
Description:
Patch to use the form of import of PIL that is pillow compatible
Filename:
MIME Type:
Creator:
Toshio Ernie Kuratomi
Created:
2013-01-09 23:42:08 UTC
Size:
6.31 KB
patch
obsolete
>Index: bkchem-0.14.0-pre2/bkchem/plugins/piddle/pdfgen.py >=================================================================== >--- bkchem-0.14.0-pre2.orig/bkchem/plugins/piddle/pdfgen.py >+++ bkchem-0.14.0-pre2/bkchem/plugins/piddle/pdfgen.py >@@ -569,7 +569,7 @@ class Canvas: > caching mechanism""" > # print "drawInlineImage: x=%s, y=%s, width = %s, height=%s " % (x,y, width, height) > try: >- import Image >+ from PIL import Image > except ImportError: > print 'Python Imaging Library not available' > return >Index: bkchem-0.14.0-pre2/bkchem/plugins/piddle/pdfutils.py >=================================================================== >--- bkchem-0.14.0-pre2.orig/bkchem/plugins/piddle/pdfutils.py >+++ bkchem-0.14.0-pre2/bkchem/plugins/piddle/pdfutils.py >@@ -15,7 +15,7 @@ LINEEND = '\015\012' > ########################################################## > def cacheImageFile(filename): > "Processes the image as if for encoding, saves to a file ending in AHX" >- import Image >+ from PIL import Image > import zlib > img1 = Image.open(filename) > img = img1.convert('RGB') >Index: bkchem-0.14.0-pre2/bkchem/plugins/piddle/piddleGL.py >=================================================================== >--- bkchem-0.14.0-pre2.orig/bkchem/plugins/piddle/piddleGL.py >+++ bkchem-0.14.0-pre2/bkchem/plugins/piddle/piddleGL.py >@@ -272,7 +272,7 @@ class _GLCanvas(Canvas): > base, ext = os.path.splitext(fname) > if ext != '.ppm': > try: >- import Image >+ from PIL import Image > except ImportError: > raise ImportError, 'Saving to a non-PPM format is not available because PIL is not installed' > savefname = base+'.ppm' >Index: bkchem-0.14.0-pre2/bkchem/plugins/piddle/piddlePIL.py >=================================================================== >--- bkchem-0.14.0-pre2.orig/bkchem/plugins/piddle/piddlePIL.py >+++ bkchem-0.14.0-pre2/bkchem/plugins/piddle/piddlePIL.py >@@ -28,7 +28,7 @@ Joe Strout (joe@strout.net), 10/26/99 > ### 6/22/99: updated drawString to handle non-integer x and y > > from piddle import * >-import Image >+from PIL import Image > import string > > import os, sys >@@ -97,7 +97,7 @@ def _matchingFontPath(font): > return string.split(path,os.sep)[-1] > > def _pilFont(font): >- import ImageFont >+ from PIL import ImageFont > if font.face: face = font.face > else: face = 'times' > >@@ -122,7 +122,7 @@ class PILCanvas( Canvas ): > > def __init__(self, size=(300,300), name='piddlePIL'): > self._image = Image.new('RGB',size, (255,255,255)) >- import ImageDraw >+ from PIL import ImageDraw > self._pen = ImageDraw.ImageDraw(self._image) > self._pen.setink(0) > self._setFont( Font() ) >@@ -340,7 +340,7 @@ class PILCanvas( Canvas ): > tempsize = max(sWidth*1.2, sHeight*2.0) > > tempimg = Image.new('RGB',(tempsize,tempsize), (0,0,0)) >- import ImageDraw >+ from PIL import ImageDraw > temppen = ImageDraw.ImageDraw(tempimg) > temppen.setink( (255,255,255) ) > pilfont = _pilFont(font) >Index: bkchem-0.14.0-pre2/bkchem/plugins/piddle/piddlePS.py >=================================================================== >--- bkchem-0.14.0-pre2.orig/bkchem/plugins/piddle/piddlePS.py >+++ bkchem-0.14.0-pre2/bkchem/plugins/piddle/piddlePS.py >@@ -811,7 +811,7 @@ translate > calculated from image size. (x1,y1) is upper left of image, (x2,y2) is lower right of > image in piddle coordinates.""" > try: >- import Image >+ from PIL import Image > except ImportError: > print 'Python Imaging Library not available' > return >@@ -893,7 +893,7 @@ translate > > def _drawImageLevel2(self, image, x1,y1, x2=None,y2=None): # Postscript Level2 version > try: >- import Image >+ from PIL import Image > except ImportError: > print 'Python Imaging Library not available' > return >Index: bkchem-0.14.0-pre2/bkchem/plugins/piddle/piddleQD.py >=================================================================== >--- bkchem-0.14.0-pre2.orig/bkchem/plugins/piddle/piddleQD.py >+++ bkchem-0.14.0-pre2/bkchem/plugins/piddle/piddleQD.py >@@ -566,7 +566,7 @@ def test(): > #fsspec, ok = macfs.PromptGetFile("Image File:") > #if not ok: return > #path = fsspec.as_pathname() >- #import Image >+ #from PIL import Image > #canvas.drawImage( Image.open(path), 0,0,300,300 ); > > def myOnClick(canvas,x,y): print "clicked %s,%s" % (x,y) >Index: bkchem-0.14.0-pre2/bkchem/plugins/piddle/piddletest.py >=================================================================== >--- bkchem-0.14.0-pre2.orig/bkchem/plugins/piddle/piddletest.py >+++ bkchem-0.14.0-pre2/bkchem/plugins/piddle/piddletest.py >@@ -81,7 +81,7 @@ def drawAdvanced(canvas): > canvas.drawFigure(figure, fillColor=yellow, edgeWidth=4) > > try: >- import Image >+ from PIL import Image > except: > canvas.drawString("PIL not available!", 20,200) > Image = None >Index: bkchem-0.14.0-pre2/bkchem/plugins/piddle/piddleTK.py >=================================================================== >--- bkchem-0.14.0-pre2.orig/bkchem/plugins/piddle/piddleTK.py >+++ bkchem-0.14.0-pre2/bkchem/plugins/piddle/piddleTK.py >@@ -347,7 +347,7 @@ class BaseTKCanvas(piddle.Canvas): > def drawImage(self, image, x1, y1, x2=None,y2=None): > > try: >- import ImageTk >+ from PIL import ImageTk > except ImportError: > raise NotImplementedError('drawImage - require the ImageTk module') > >Index: bkchem-0.14.0-pre2/bkchem/plugins/piddle/PixMapWrapper.py >=================================================================== >--- bkchem-0.14.0-pre2.orig/bkchem/plugins/piddle/PixMapWrapper.py >+++ bkchem-0.14.0-pre2/bkchem/plugins/piddle/PixMapWrapper.py >@@ -220,7 +220,7 @@ class PixMapWrapper: > > def toImage(self): > """Return the contents of this PixMap as a PIL Image object.""" >- import Image >+ from PIL import Image > # our tostring() method returns data in ARGB format, > # whereas Image uses RGBA; a bit of slicing fixes this... > data = self.tostring()[1:] + chr(0) >@@ -230,7 +230,7 @@ class PixMapWrapper: > def test(): > import MacOS > import macfs >- import Image >+ from PIL import Image > fsspec, ok = macfs.PromptGetFile("Image File:") > if not ok: return > path = fsspec.as_pathname()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 893804
: 675944