SFML community forums

Help => Graphics => Topic started by: AcaMilanovic on January 18, 2011, 08:15:00 pm

Title: Failed to create image
Post by: AcaMilanovic on January 18, 2011, 08:15:00 pm
Hi,

I am using SFML on Linux. When I try to load an image it fails with error "Failed to create image, its internal size is too high (128x128)". I tried to load a smaller image, but it also returns the same error. Do you have an idea how to make it work ? It's a PNG image.

P.S. The image is in the right folder, and I even tried to use absolute path, and it didn't help.
Title: Failed to create image
Post by: Laurent on January 18, 2011, 08:19:14 pm
Can you show your code? Are your graphics drivers up to date? Can you run glxgears?
Title: Failed to create image
Post by: AcaMilanovic on January 18, 2011, 08:29:39 pm
I can run glxgears. Graphics drivers are up to date. I'm using Ubuntu 11.04 x64 and ATI/AMD proprietary FGLRX drivers.

Code: [Select]

    /* Loading image. */
    sf::Image imgGame;
    imgGame.LoadFromFile("buttonGame.png");

    /* Setting image. */
    buttonGame.SetImage(imgGame);
    buttonGame.SetPosition(225,200);
Title: Failed to create image
Post by: Laurent on January 18, 2011, 11:05:20 pm
I mean a complete code that I can test :)
Title: Failed to create image
Post by: AcaMilanovic on January 19, 2011, 10:40:52 am
Thank you Laurent, I just figured myself out what was wrong. I've been loading the image in a class destructor.  :roll: