error with py2exe using image

Under the same configuration than yours, I've got the same message under Python when I move all my files to another directory ...

oliver.tomic@matforsk.no a écrit :

···

Hi folks,

my setup:

Windows XP
Python 2.3
wxPython 2.5.2.8.

I have made a small application that uses an image (bmp) in it. It works
fine when I start it from python, but as soon as I create an executable
(*.exe) with py2exe it will not work anymore. I get the following error
message when I start the executable:

Traceback (most recent call last):
File "WineTest.py", line 332, in ?
File "WineTest.py", line 250, in __init__
File "wx\_core.pyc", line 2282, in ConvertToBitmap
wx._core.PyAssertionError: C++ assertion "wxAssertFailure" failed in
..\..\src\msw\bitmap.cpp(795): invalid image

this is the part in the application where I insert the image:

jpg = wx.Image('MLogo.bmp', wx.BITMAP_TYPE_BMP).ConvertToBitmap()
bmp = wx.StaticBitmap(self, -1, jpg, (0, 0), (jpg.GetWidth(),
jpg.GetHeight()))
....
sizer.Add(bmp, 0, wx.EXPAND|wx.ALL, 5)

this is the setup.py that I use to create the executable:

from distutils.core import setup
import py2exe

setup(
   # targets to build
   windows = ["WineTest.py"],
   data_files=[("bitmaps",
                  ["MLogo.bmp"])]
   )

I understand that this has something to do with the image, but I have no
idea where to go from here. The executable works perfectly when I leave out
the image.
Has someone experience with this?

Thanks in advance for your help!

Oliver

=================
Oliver Tomic
MATFORSK - Norwegian Food Research Institute
Osloveien 1
1430 Ås
Norway

Tel.: 0047 6497 0252
Fax: 0047 6497 0333
Mob.: 0047 9574 6167

http://www.matforsk.no

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

__________ Information NOD32 1.927 (20041119) __________

Ce message a ete verifie par NOD32 Antivirus System.
part000.txt - est OK

http://www.nod32.com