[Image-SIG] Problems with PIL1.1.4 using Py2exe
by >>>Gabriele Tazzari other posts by this author
Jul 17 2004 6:23PM messages near this date
[Image-SIG] (no subject)
|
[Image-SIG] Re: Problems with PIL1.1.4 using Py2exe
This is a multi-part message in MIME format.
------=_NextPart_000_0005_01C46C3B.F4F90FD0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,=20
I'm trying to compile and transform an application that uses the PIL =
1.1.4 and transform it in an exe file using py2exe.
This is the python code:
import os,shutil,Image
a=3DImage.open("test.jpg")
b=3Da.resize((150,80),Image.ANTIALIAS)
b.save("d:/test_script.jpg")
a=3DNone
b=3DNone
And this is the setup script:
# setup.py
from distutils.core import setup
import py2exe
setup(name=3D"testpil.py",scripts=3D["testpil.py"],)
and of course the script is called in this way:
setup.py py2exe
Can you please tell me why the script runs and the exe doesn't ?
The error I get with the exe is=20
Traceback (most recent call last):
File "<string> ", line 2, in ?
File "Image.pyo", line 1571, in open
IOError: cannot identify image file
It can't open the image file...
Can you advise please?
Thanks
Gabriele Tazzari
------=_NextPart_000_0005_01C46C3B.F4F90FD0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML> <HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR>
<STYLE> </STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV> <FONT face=3DArial size=3D2>Hi, <BR>I'm trying to compile and =
transform an=20
application that uses the PIL 1.1.4 and transform it in an exe file =
using=20
py2exe.</FONT> </DIV>
<DIV> <FONT face=3DArial size=3D2></FONT> </DIV>
<DIV> <FONT face=3DArial size=3D2>This is the python code:</FONT></DIV>
<DIV> <FONT face=3DArial size=3D2></FONT> </DIV>
<DIV> <FONT face=3DArial size=3D2> import=20
os,shutil,Image<BR> =20
a=3DImage.open("test.jpg")<BR> =20
b=3Da.resize((150,80),Image.ANTIALIAS)<BR> =20
b.save("d:/test_script.jpg")<BR> =
a=3DNone<BR> =20
b=3DNone</FONT> </DIV>
<DIV> <FONT face=3DArial size=3D2></FONT> </DIV>
<DIV> <FONT face=3DArial size=3D2></FONT> </DIV>
<DIV> <FONT face=3DArial size=3D2>And this is the setup =
script:</FONT> </DIV>
<DIV> <FONT face=3DArial size=3D2></FONT> </DIV>
<DIV> <FONT face=3DArial size=3D2> # =
setup.py<BR> =20
from distutils.core import setup<BR> import=20
py2exe</FONT> </DIV>
<DIV> <FONT face=3DArial size=3D2> =20
setup(name=3D"testpil.py",scripts=3D["testpil.py"],)</FONT> </DIV>
<DIV> <FONT face=3DArial size=3D2></FONT> </DIV>
<DIV> <FONT face=3DArial size=3D2>and of course the script is called in =
this=20
way:</FONT> </DIV>
<DIV> <FONT face=3DArial size=3D2></FONT> </DIV>
<DIV> <FONT face=3DArial size=3D2>setup.py py2exe</FONT></DIV>
<DIV> <FONT face=3DArial size=3D2></FONT> </DIV>
<DIV> <FONT face=3DArial size=3D2></FONT> </DIV>
<DIV> <FONT face=3DArial size=3D2>Can you please tell me why the script =
runs and the=20
exe doesn't ?</FONT> </DIV>
<DIV> <FONT face=3DArial size=3D2>The error I get with the exe is =
</FONT> </DIV>
<DIV> <FONT face=3DArial size=3D2></FONT> </DIV>
<DIV> <FONT face=3DArial size=3D2> Traceback (most =
recent call=20
last):<BR> File "<string>", line 2, in=20
?<BR> File "Image.pyo", line 1571, in=20
open<BR> IOError: cannot identify image =
file</FONT> </DIV>
<DIV> <FONT face=3DArial size=3D2></FONT> </DIV>
<DIV> <FONT face=3DArial size=3D2>It can't open the image =
file...</FONT> </DIV>
<DIV> <FONT face=3DArial size=3D2>Can you advise please?</FONT></DIV>
<DIV> <FONT face=3DArial size=3D2>Thanks</FONT></DIV>
<DIV> <FONT face=3DArial size=3D2></FONT> </DIV>
<DIV> <FONT face=3DArial size=3D2>Gabriele Tazzari</FONT></DIV>
<DIV> <FONT face=3DArial size=3D2></FONT> </DIV>
<DIV> <FONT face=3DArial size=3D2></FONT> </DIV></BODY></HTML>
------=_NextPart_000_0005_01C46C3B.F4F90FD0--
Attachments:
unknown1
Thread:
>>>Gabriele Tazzari
Fredrik Lundh
|