Results 1 to 5 of 5

Thread: [mac] QImage.load fails

  1. #1
    Join Date
    Nov 2007
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X

    Default [mac] QImage.load fails

    In my little app, i have the following code:

    Qt Code:
    1. if ( ! b.load(fileName) ) {
    2. cerr << "Could not load image: " << qPrintable(fileName) << endl;
    3. }
    To copy to clipboard, switch view to plain text mode 

    This works just fine under Windows and Linux, but i can't get it to work under Mac OS X (10.4.10).
    I am using Qt 4.3.1

    The filename and its permissions are OK.

    I have also checked the path of the image formats plugins with this code:
    Qt Code:
    1. QStringList paths = QCoreApplication::libraryPaths();
    2. for ( QStringList::Iterator p = paths.begin(); p != paths.end(); ++ p )
    3. printf( "%s:", (*p).toLatin1().constData() );
    To copy to clipboard, switch view to plain text mode 
    This path seems to be OK, too.

    Does anyone have an idea why QImage does not load the image?

    Can I get more info why it does not load the image?

    Any pointers, hints, suggestions, etc., will be highly appreciated.

    Best regards,
    Gabriel.

  2. #2
    Join Date
    Oct 2007
    Location
    Munich, Bavaria
    Posts
    144
    Thanks
    1
    Thanked 19 Times in 19 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: [mac] QImage.load fails

    Just a rough guess: do you have the necessary image plugin available on Mac?

  3. #3
    Join Date
    Nov 2007
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: [mac] QImage.load fails

    I think so:

    % ll /usr/local/qt/plugins/imageformats/
    -rwxr-xr-x 1 root wheel 46K Aug 28 12:20 libqgif.dylib*
    -rwxr-xr-x 1 root wheel 558K Aug 28 12:20 libqgif_debug.dylib*
    -rwxr-xr-x 1 root wheel 167K Aug 28 12:20 libqjpeg.dylib*
    -rwxr-xr-x 1 root wheel 1M Aug 28 12:20 libqjpeg_debug.dylib*
    -rwxr-xr-x 1 root wheel 345K Aug 28 12:20 libqmng.dylib*
    -rwxr-xr-x 1 root wheel 1M Aug 28 12:20 libqmng_debug.dylib*
    -rwxr-xr-x 1 root wheel 41K Aug 28 12:20 libqsvg.dylib*
    -rwxr-xr-x 1 root wheel 557K Aug 28 12:20 libqsvg_debug.dylib*
    -rwxr-xr-x 1 root wheel 331K Aug 28 12:20 libqtiff.dylib*
    -rwxr-xr-x 1 root wheel 1M Aug 28 12:20 libqtiff_debug.dylib*

  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: [mac] QImage.load fails

    J-P Nurmi

  5. #5
    Join Date
    Nov 2007
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: [mac] QImage.load fails

    Thanks a lot!

    I have found this list of image formats:
    bmp , pbm , pgm , png , ppm , xbm , xpm

    Which I got with this code:

    Qt Code:
    1. QList<QByteArray> formats = QImageReader::supportedImageFormats();
    2. for ( QList<QByteArray>::Iterator f = formats.begin(); f != formats.end(); ++ f )
    3. printf("%s , ", f->constData() );
    To copy to clipboard, switch view to plain text mode 

    First of all, I am really supprised, because from QCoreApplication::libraryPaths() I've ot this path: /usr/local/qt-4.3.1/plugins
    And there is the sub-directory imageformats, and in that there is libqjpeg.dylib .
    So why is that?

    Second, the question, of course is, what can I do?

    Best regards,
    Gabriel.

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.