ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> image-sig
image-sig
[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>&nbsp;</DIV>
<DIV> <FONT face=3DArial size=3D2>This is the python code:</FONT></DIV>
<DIV> <FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV> <FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; import=20
os,shutil,Image<BR> &nbsp;&nbsp;&nbsp;=20
a=3DImage.open("test.jpg")<BR> &nbsp;&nbsp;&nbsp;=20
b=3Da.resize((150,80),Image.ANTIALIAS)<BR> &nbsp;&nbsp;&nbsp;=20
b.save("d:/test_script.jpg")<BR> &nbsp;&nbsp;&nbsp; =
a=3DNone<BR> &nbsp;&nbsp;&nbsp;=20
b=3DNone</FONT> </DIV>
<DIV> <FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV> <FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV> <FONT face=3DArial size=3D2>And this is the setup =
script:</FONT> </DIV>
<DIV> <FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV> <FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; # =
setup.py<BR> &nbsp;&nbsp;&nbsp;=20
from distutils.core import setup<BR> &nbsp;&nbsp;&nbsp; import=20
py2exe</FONT> </DIV>
<DIV> <FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;=20
setup(name=3D"testpil.py",scripts=3D["testpil.py"],)</FONT> </DIV>
<DIV> <FONT face=3DArial size=3D2></FONT>&nbsp;</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>&nbsp;</DIV>
<DIV> <FONT face=3DArial size=3D2>setup.py py2exe</FONT></DIV>
<DIV> <FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV> <FONT face=3DArial size=3D2></FONT>&nbsp;</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>&nbsp;</DIV>
<DIV> <FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; Traceback (most =
recent call=20
last):<BR> &nbsp;&nbsp;&nbsp; &nbsp; File "&lt;string&gt;", line 2, in=20
?<BR> &nbsp;&nbsp;&nbsp; &nbsp; File "Image.pyo", line 1571, in=20
open<BR> &nbsp;&nbsp;&nbsp; IOError: cannot identify image =
file</FONT> </DIV>
<DIV> <FONT face=3DArial size=3D2></FONT>&nbsp;</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>&nbsp;</DIV>
<DIV> <FONT face=3DArial size=3D2>Gabriele Tazzari</FONT></DIV>
<DIV> <FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV> <FONT face=3DArial size=3D2></FONT>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_0005_01C46C3B.F4F90FD0--
Attachments:
unknown1

Thread:
>>>Gabriele Tazzari
Fredrik Lundh

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved