[Image-SIG] PIL 1.1.4

Alexey Melchakov corvin at python.ru
Sun Dec 12 19:35:35 CET 2004


I meet this exception while wew using PIL:

     return PIL.Image.open(fp)
   File 
"/home/bragit-www/local/lib/python2.3/site-packages/PIL/Image.py", line 
1567, in open
     return factory(fp, filename)
   File 
"/home/bragit-www/local/lib/python2.3/site-packages/PIL/ImageFile.py", 
line 78, in __init__
     self._open()
   File 
"/home/bragit-www/local/lib/python2.3/site-packages/PIL/FpxImagePlugin.py", 
line 63, in _open
     self.ole = OleFileIO(self.fp)
   File 
"/home/bragit-www/local/lib/python2.3/site-packages/PIL/OleFileIO.py", 
line 253, in __init__
     self.open(filename)
   File 
"/home/bragit-www/local/lib/python2.3/site-packages/PIL/OleFileIO.py", 
line 279, in open
     self.loadfat(header)
   File 
"/home/bragit-www/local/lib/python2.3/site-packages/PIL/OleFileIO.py", 
line 298, in loadfat
     if ix == 0xFFFFFFFEL or x == 0xFFFFFFFFL:
NameError: global name 'x' is not defined


It seems like a misstype, code should look like this:


--- OleFileIO.py.orig   Sun Dec 12 21:32:33 2004
+++ OleFileIO.py        Sun Dec 12 21:32:36 2004
@@ -295,7 +295,7 @@
          fat = []
          for i in range(0, len(sect), 4):
              ix = i32(sect, i)
-            if ix == 0xFFFFFFFEL or x == 0xFFFFFFFFL:
+            if ix == 0xFFFFFFFEL or ix == 0xFFFFFFFFL:
                  break
              s = self.getsect(ix)
              fat = fat + map(lambda i, s=s: i32(s, i), range(0, len(s), 4))


-- 
corvin at python.ru
CRV-RIPN


More information about the Image-SIG mailing list