[Image-SIG] PIL problems

Vadim Suvorov vsuvorov@cccglobal.com
Sat, 20 May 2000 21:47:00 -0500


This is a multi-part message in MIME format.

------=_NextPart_000_0000_01BFC2A4.EDC37CE0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

Hello,

I just started to use PIL 1.01b (of 11/01/99) and have a few problems:

1. I can not read black/white bitmaps (
...
  File "C:\Program Files\Python\Lib\PIL\BmpImagePlugin.py", line 136, in
_open
    self._bitmap()
  File "C:\Program Files\Python\Lib\PIL\BmpImagePlugin.py", line 85, in
_bitmap
    raise IOError, "Unknown BMP header type"
IOError: Unknown BMP header type

). I used MS Paint to save file in 1-bit per point mode.

2. I have a bitmap of 3086 x 2775 256 colors. An attempt to use viewer to
display it causes Python failure in TK80:

PYTHON caused an invalid page fault in
module TK80.DLL at 015f:00c8f329.
Registers:
EAX=00000000 CS=015f EIP=00c8f329 EFLGS=00010206
EBX=1e152a10 SS=0167 ESP=0063f534 EBP=0063f538
ECX=00000000 DS=0167 ESI=004acfe4 FS=441f
EDX=0045059c ES=0167 EDI=00450e80 GS=0000
Bytes at CS:EIP:
89 51 08 8b e5 5d c3 55 8b ec 83 ec 34 8b 45 0c
Stack dump:
00000000 0063f57c 00cce658 00000000 0045059c 00450e80 004acfe4 00000c0e
00000ad7 0063f5a4 00000000 00000000 0ad70c0e 00000020 00000002 00000000

Is there any limits on what can be viewed?

3. An attempt to process images like:

import Image

...

fails with message:

  File "C:\Program Files\Python\Lib\PIL\ImageDraw.py", line 29, in __init__
    im.load()
  File "C:\Program Files\Python\Lib\PIL\ImageFile.py", line 117, in load
    self.map = Image.core.map(self.filename)
  File "C:\Program Files\Python\Lib\PIL\Image.py", line 40, in __getattr__
    raise ImportError, "The _imaging C module is not installed"
ImportError: The _imaging C module is not installed


However,

import Tkinter
import Image
...

fixes the situation. I do not understand how this is related (Python-wise).

4. In the same bitmap from 2 (3086 x 2775 256 colors), I tried to draw a
line:

draw = ImageDraw.Draw(im)
draw.line(((0, 0), im.size), fill=128)

An operation fails with message:

PYTHON caused an invalid page fault in
module _IMAGING.DLL at 015f:00d653b0.
Registers:
EAX=00000000 CS=015f EIP=00d653b0 EFLGS=00010293
EBX=86ae1996 SS=0167 ESP=0063faa0 EBP=000015ae
ECX=00000c80 DS=0167 ESI=000009a0 FS=593f
EDX=00000000 ES=0167 EDI=00806620 GS=0000
Bytes at CS:EIP:
88 0c 03 85 f6 7c 0c 8b 5c 24 20 03 d3 8b 5c 24
Stack dump:
00806870 00000000 0063fb08 00000000 00d65f1f 00806620 00000001 0000181c
00000001 00000c0e 00000080 00d5421b 00806620 00000000 00000000 00000c0e

I appreciate your help,

Vadim





------=_NextPart_000_0000_01BFC2A4.EDC37CE0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.72.3110.7"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<P><FONT size=3D2><FONT face=3DArial>Hello,<BR><BR>I just started to use =
PIL 1.01b=20
(of 11/01/99) and have a few problems:<BR><BR>1. I can not read =
black/white=20
bitmaps (<BR>...<BR></FONT><FONT face=3D"Courier New">&nbsp; File =
&quot;C:\Program=20
Files\Python\Lib\PIL\BmpImagePlugin.py&quot;, line 136, in=20
_open<BR>&nbsp;&nbsp;&nbsp; self._bitmap()<BR>&nbsp; File =
&quot;C:\Program=20
Files\Python\Lib\PIL\BmpImagePlugin.py&quot;, line 85, in=20
_bitmap<BR>&nbsp;&nbsp;&nbsp; raise IOError, &quot;Unknown BMP header=20
type&quot;<BR>IOError: Unknown BMP header type<BR></FONT><BR><FONT =
face=3DArial>).=20
I used MS Paint to save file in 1-bit per point mode.</FONT></FONT><FONT =

face=3DArial></FONT></P>
<P><FONT size=3D2><FONT face=3DArial>2. I have a bitmap of 3086 x 2775 =
256 colors.=20
An attempt to use viewer to display it causes Python failure in=20
TK80:</FONT></FONT><FONT face=3DArial></FONT></P>
<P><FONT size=3D2><FONT face=3D"Courier New">PYTHON caused an invalid =
page fault=20
in<BR>module TK80.DLL at 015f:00c8f329.<BR>Registers:<BR>EAX=3D00000000 =
CS=3D015f=20
EIP=3D00c8f329 EFLGS=3D00010206<BR>EBX=3D1e152a10 SS=3D0167 =
ESP=3D0063f534=20
EBP=3D0063f538<BR>ECX=3D00000000 DS=3D0167 ESI=3D004acfe4 =
FS=3D441f<BR>EDX=3D0045059c=20
ES=3D0167 EDI=3D00450e80 GS=3D0000<BR>Bytes at CS:EIP:<BR>89 51 08 8b e5 =
5d c3 55 8b=20
ec 83 ec 34 8b 45 0c <BR>Stack dump:<BR>00000000 0063f57c 00cce658 =
00000000=20
0045059c 00450e80 004acfe4 00000c0e <BR>00000ad7 0063f5a4 00000000 =
00000000=20
0ad70c0e 00000020 00000002 00000000 </FONT></FONT></P>
<P><FONT color=3D#000000 face=3DArial size=3D2>Is there any limits on =
what can be=20
viewed?</FONT></P>
<P><FONT face=3DArial size=3D2>3. An attempt to process images =
like:</FONT></P><FONT=20
face=3DArial size=3D2>
<P><FONT face=3D"Courier New">import Image</FONT></P>
<P><FONT face=3D"Courier New">...</FONT></P>
<P>fails with message:</P>
<P><FONT face=3DCourier>&nbsp; File &quot;C:\Program=20
Files\Python\Lib\PIL\ImageDraw.py&quot;, line 29, in=20
__init__<BR>&nbsp;&nbsp;&nbsp; im.load()<BR>&nbsp; File &quot;C:\Program =

Files\Python\Lib\PIL\ImageFile.py&quot;, line 117, in =
load<BR>&nbsp;&nbsp;&nbsp;=20
self.map =3D Image.core.map(self.filename)<BR>&nbsp; File =
&quot;C:\Program=20
Files\Python\Lib\PIL\Image.py&quot;, line 40, in=20
__getattr__<BR>&nbsp;&nbsp;&nbsp; raise ImportError, &quot;The _imaging =
C module=20
is not installed&quot;<BR>ImportError: The _imaging C module is not=20
installed<BR></FONT></P>
<P>However, </P><FONT face=3DArial size=3D2>
<P><FONT face=3D"Courier New">import Tkinter<BR></FONT><FONT=20
face=3D"Courier New">import Image<BR></FONT><FONT=20
face=3D"Courier New">...</FONT></P></FONT>
<P>fixes the situation. I do not understand how this is related=20
(Python-wise).</P>
<P>4. In the same bitmap from 2 (3086 x 2775 256 colors), I tried to =
draw a=20
line:</P>
<P><FONT face=3D"Courier New">draw =3D =
ImageDraw.Draw(im)<BR>draw.line(((0, 0),=20
im.size), fill=3D128)</FONT></P>
<P>An operation fails with message:</P>
<P><FONT face=3DCourier>PYTHON caused an invalid page fault in<BR>module =

_IMAGING.DLL at 015f:00d653b0.<BR>Registers:<BR>EAX=3D00000000 CS=3D015f =

EIP=3D00d653b0 EFLGS=3D00010293<BR>EBX=3D86ae1996 SS=3D0167 =
ESP=3D0063faa0=20
EBP=3D000015ae<BR>ECX=3D00000c80 DS=3D0167 ESI=3D000009a0 =
FS=3D593f<BR>EDX=3D00000000=20
ES=3D0167 EDI=3D00806620 GS=3D0000<BR>Bytes at CS:EIP:<BR>88 0c 03 85 f6 =
7c 0c 8b 5c=20
24 20 03 d3 8b 5c 24 <BR>Stack dump:<BR>00806870 00000000 0063fb08 =
00000000=20
00d65f1f 00806620 00000001 0000181c <BR>00000001 00000c0e 00000080 =
00d5421b=20
00806620 00000000 00000000 00000c0e </FONT></P>
<P>I appreciate your help,</P>
<P>Vadim<BR></P>
<P>&nbsp;</P></FONT></BODY></HTML>

------=_NextPart_000_0000_01BFC2A4.EDC37CE0--