Results 1 to 4 of 4

Thread: Low-level error conditions on QImage.load()

  1. #1
    Join Date
    Jan 2007
    Posts
    91
    Thanks
    21
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Low-level error conditions on QImage.load()

    Along a related line as the previous question, I have a 'gif' file (running on Microsoft XP). I can open the file using fopen("filename.gif", "rb"), but when I attempt to load the image using either QImage.load("filename.gif", "GIF") or QPixmap.load("filename.gif", "GIF"), it returns false. Are there any lowerlevel error messages set to help me determine why it wont' load the filename.gif into the image? I can load it into an graphical editor just fine.
    - Bruce

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Low-level error conditions on QImage.load()

    You can use QImageReader class and its error() and errorString() methods.

    What does QImageReader::supportedImageFormats() return? Your Qt probably wasn't compiled with GIF support.

  3. #3
    Join Date
    Jan 2007
    Posts
    91
    Thanks
    21
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: Low-level error conditions on QImage.load()

    How do I compile Qt with GIF support or is that something that TrollTech has to do?

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Low-level error conditions on QImage.load()

    Try running "configure -help" wherever you Qt is installed to (eg. C:\Qt\4.2.2).

    It will show you that the default option for GIF support is "-no-gif". To compile Qt with GIF support turned on, pass "-qt-gif" as a parameter to the configure.
    C:\Qt\4.2.2\> configure -qt-gif
    Once the configure finishes, you are ready to recompile Qt. Follow the instructions as it depends on the compiler you are using.
    J-P Nurmi

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.