#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    3
    Rep Power
    0

    Post Help me support load image by pygame on centos


    I'm study python. I have some problem when load image by pygame on centos.
    that's error: "pygame.error: File is not a Windows BMP file"
    I can't understand why and how to resolve that. Please help me.
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,837
    Rep Power
    480
    Answer to yourself "Which file is pygame looking for?"

    Hereafter I'll pretend that file is
    /usr/games/dum/images/b.bmp

    At bash prompt you'll next command
    $ file /usr/games/dum/images/b.bmp

    We all expect this is not a bmp format file. Let's suppose that it is instead some other form of image file.
    Next command to your bash prompt:
    Code:
    $ pushd /usr/games/dum/images
    $ convert b.bmp this_name_differs_from_all_other_names_in_the_directory.bmp
    $ mv b.bmp b.bmp.bak
    $ mv this_name_differs_from_all_other_names_in_the_directory.bmp b.bmp
    $ popd
    Don't have convert? Put on your system administrator shoes with
    $ sudo yum install imagemagick
    or whatever the command happens to be.

    If this doesn't resolve the issue you'll have the burden to provide more information.
    [code]Code tags[/code] are essential for python code and Makefiles!
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    3
    Rep Power
    0
    after I setup imagemagick, show() function can be executable.
    but I still can't load PNG file by Python image library
    and load only BMP file by Pygame, other extension file can't load.

    Do you know how to setup ffmpeg for python on window and centos?
    I can't setup Cython on window, error is: error: Unable to find vcvarsall.bat

    I try to setup MinGW, but when run file setup, it asked download other file, but download false.
    how to solve
  6. #4
  7. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,837
    Rep Power
    480
    imagemagick also provides the identify command that will tell you about your image. For example:
    Code:
    $ identify 23.bmp
    23.bmp BMP 2982x625 2982x625+0+0 8-bit PseudoClass 256c 1.866MB 0.000u 0:00.019
    I don't understand why you're using MinGW compiler on centos, unless you're trying to run your program with wine.
    [code]Code tags[/code] are essential for python code and Makefiles!
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    3
    Rep Power
    0
    I setup MinGW on window, I can't setup pyfmpeg on window and centos, so some suggest for me that's setup MinGW, so I try to do that

IMN logo majestic logo threadwatch logo seochat tools logo