Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Failed to create image  (Read 2540 times)

0 Members and 1 Guest are viewing this topic.

AcaMilanovic

  • Newbie
  • *
  • Posts: 3
    • View Profile
Failed to create image
« 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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Failed to create image
« Reply #1 on: January 18, 2011, 08:19:14 pm »
Can you show your code? Are your graphics drivers up to date? Can you run glxgears?
Laurent Gomila - SFML developer

AcaMilanovic

  • Newbie
  • *
  • Posts: 3
    • View Profile
Failed to create image
« Reply #2 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);

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Failed to create image
« Reply #3 on: January 18, 2011, 11:05:20 pm »
I mean a complete code that I can test :)
Laurent Gomila - SFML developer

AcaMilanovic

  • Newbie
  • *
  • Posts: 3
    • View Profile
Failed to create image
« Reply #4 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:

 

anything