Python 2.3b1 and PIL 1.1.4b1

Hans-Joachim Widmaier hjwidmaier at web.de
Wed May 7 02:02:21 EDT 2003


rshaw2 at midsouth.rr.com (Richard) wrote in message news:<84e0f331.0305051046.459b9c4b at posting.google.com>...
> I was using Python 2.2.2 and PIL 1.1.3 just fine to write a GUI image
> viewer/editor using Tkinter for the GUI. Now when I try to run it in
> the lastest version of both I get an import error for "_imagingtk".

What OS? I had the same problem, compiling on Linux.
I needed to patch setup.py like that:

--- Imaging-1.1.4a4-orig/setup.py       Mon Apr 28 13:29:21 2003
+++ Imaging-1.1.4a4/setup.py    Tue Apr 22 18:11:27 2003
@@ -119,7 +119,7 @@
     pass
 else:
     INCLUDE_DIRS = ["libImaging"]
-    LIBRARY_DIRS = ["libImaging", "/usr/X11R6/include"]
+    LIBRARY_DIRS = ["libImaging"]
     LIBRARIES = ["Imaging"]

Furthermore, if you run Tcl/Tk 8.4, you need to patch Tk/tkImaging.c
as well (sorry, this patch is against an even older version, but it
might hint at what to do):

--- Tk/tkImaging.c.orig 2002-10-26 19:43:00.000000000 +0200
+++ Tk/tkImaging.c      2002-10-26 19:44:50.000000000 +0200
@@ -61,7 +61,7 @@
 
 static int
 PyImagingPhoto(ClientData clientdata, Tcl_Interp* interp,
-               int argc, char **argv)
+               int argc, CONST char **argv)
 {
     Imaging im;
     Tk_PhotoHandle photo;
@@ -162,7 +162,7 @@
                     if (w > 0) {
                         run.width = w;
                         run.pixelPtr = s;
-                        Tk_PhotoPutBlock(photo, &run, x-w, y,
run.width, 1);
+                        Tk_PhotoPutBlock(photo, &run, x-w, y,
run.width, 1, TK_PHOTO_COMPOSITE_OVERLAY);
                     }
                     w = 0;
                 }
@@ -172,14 +172,14 @@
                 /* copy final run, if any */
                 run.width = w;
                 run.pixelPtr = s;
-                Tk_PhotoPutBlock(photo, &run, x-w, y, run.width, 1);
+                Tk_PhotoPutBlock(photo, &run, x-w, y, run.width, 1,
TK_PHOTO_COMPOSITE_OVERLAY);
           }
         }
 
     } else
 
         /* Copy opaque block to photo image, and leave the rest to TK
*/
-        Tk_PhotoPutBlock(photo, &block, 0, 0, block.width,
block.height);
+        Tk_PhotoPutBlock(photo, &block, 0, 0, block.width,
block.height, TK_PHOTO_COMPOSITE_OVERLAY);
 
     return TCL_OK;
 }


I expect that PIL 1.1.4 final will fix these little problems.

Hope this helps.

Hans-J.




More information about the Python-list mailing list