#10 Can't load image in windows

closed-works-for-me
None
5
2001-01-18
2001-01-12
ykchew
No

The Boa can't load BMP image.
I search up the code and discover that the path of bitmap (pyPath) is not correct when join together with bitmap location.

the path become as "d:\python20\Boa\images/shared/help.bmp"
so the program prompt error.

However, the problem is solved when I change the code as following in editor.py:

if sys.platform == "win32":
openBmp = 'Images\\Editor\\Open.bmp'
helpBmp = 'Images\\Shared\\Help.bmp'
else:
openBmp = 'Images/Editor/Open.bmp'
helpBmp = 'Images/Shared/Help.bmp'

Discussion

  • Riaan Booysen

    Riaan Booysen - 2001-01-18

    I do not understand why this gave you problems, it certainly works for me.
    The rest of the filepaths in Boa are also in unix format '/' but they work for you?

     
  • Riaan Booysen

    Riaan Booysen - 2001-01-18
    • assigned_to: nobody --> riaan
    • status: open --> closed-works-for-me
     
  • Nobody/Anonymous

    The rest of the filepaths is used with function path.join
    but the openBmp (string) have beed fix to 'Images/Editor/Open.bmp'
    which can not be solved as join..

    My spec of running boa are :
    P3 550
    64 ram
    python 2.0

     
  • Riaan Booysen

    Riaan Booysen - 2001-01-19

    In the Python Interpreter I can load any file on windows
    with any combination of / or \\s.
    e.g.

    >>> f.open('d:\\a/b\\' + os.path.join('c/d/', 'e\\f\\g'))

    Works fine for me on 1.5.2 and 2.0. It is currently the convention in Boa to specify all filepaths in Unix format.

    Please print your traceback, or an example in the Python Interpreter Shell where you cannot load a mixed slash filename in windows.

     
  • Nobody/Anonymous

    p3 550
    64 ram
    activestate python 2.0
    window 98

    the following is the message show up when i try to run Boa without modify the path.

    17:00:43: Failed to load icon from the file 'D:\Python20\Boa\Images/Icons/Editor.ico' (error 0: the operation completed successfully.)
    17:00:43: Couldn't add an image to the image list.
    17:00:43: Couldn't add an image to the image list.
    17:00:43: Couldn't add an image to the image list.
    17:00:43: Couldn't add an image to the image list.
    17:00:43: Couldn't add an image to the image list.
    17:00:43: Couldn't add an image to the image list.
    17:00:43: Couldn't add an image to the image list.
    17:00:43: Couldn't add an image to the image list.
    17:00:43: Couldn't add an image to the image list.
    17:00:43: Couldn't add an image to the image list.
    17:00:43: Couldn't add an image to the image list.
    17:00:43: Couldn't add an image to the image list.
    17:00:43: Couldn't add an image to the image list.
    17:00:43: Couldn't add an image to the image list.
    17:00:43: Couldn't add an image to the image list.
    17:00:43: Couldn't add an image to the image list.
    17:00:43: Couldn't add an image to the image list.
    17:00:43: Couldn't add an image to the image list.
    17:00:43: Couldn't add an image to the image list.
    17:00:43: Couldn't add an image to the image list.
    17:00:43: Couldn't add an image to the image list.
    17:00:43: Couldn't add an image to the image list.
    17:00:44: Couldn't add an image to the image list.
    17:00:44: Couldn't add an image to the image list.
    17:00:44: Couldn't add an image to the image list.
    17:00:44: Couldn't add an image to the image list.
    17:00:44: Couldn't add an image to the image list.
    17:00:44: Couldn't add an image to the image list.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks