Blob Blame History Raw
--- bkchem-0.14.0-pre2/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
--- bkchem-0.14.0-pre2/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')
--- bkchem-0.14.0-pre2/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'
--- bkchem-0.14.0-pre2/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)
--- bkchem-0.14.0-pre2/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
--- bkchem-0.14.0-pre2/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)
--- bkchem-0.14.0-pre2/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
--- bkchem-0.14.0-pre2/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')
 
--- bkchem-0.14.0-pre2/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()