Results 1 to 5 of 5

Thread: QPixmap not loading image(from file) after deployment.

  1. #1
    Join Date
    Feb 2010
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default QPixmap not loading image(from file) after deployment.

    Hi,
    I recently deployed a small app that uses a QLabel to display a QPixmap...see the following code:

    Qt Code:
    1. QString logoFileFullPath("");
    2. if(fileFound(logoFileName, logoFileFullPath, fileList))
    3. {
    4. found = true;
    5. imageLoaded = pixmap->load(logoFileFullPath); //fails here
    6. *pixmap = pixmap->scaled(QSize(logoWidth, logoHeight),Qt::KeepAspectRatio, Qt::SmoothTransformation);
    7. label->setGeometry(QRect(logoWidth/2,30,logoWidth,logoHeight - 20));
    8. label->setPixmap(*pixmap);
    9. }
    To copy to clipboard, switch view to plain text mode 

    It works fine on my machine...but when my co-worker runs the app on another machine(mine and his machines are Windows XP) the jpg doesn't show up....it fails at the load step because imageLoaded is false on his machine after that line. Anybody, know why this would happen? I deployed all the dlls that Dependency Walker listed with the app. The resource is definitely being found by the app(I added code to print some debug info, it found the file but failed to load it.) Thanks for any ideas!

    edit: I noticed the jpg I was trying to load has an embedded color profile "Color LCD" in it. I converted it to something to do with RGB. Haven't gotten my coworker to test it yet, but could that have anything to do with it? If so, why would it work on my windows machine and not his?

    csmithmaui
    Last edited by csmithmaui; 22nd February 2010 at 23:29.

  2. #2
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QPixmap not loading image(from file) after deployment.

    did you properly deploy the jpeg plugin?
    I always test deployment inside a vm.

  3. #3
    Join Date
    Feb 2010
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QPixmap not loading image(from file) after deployment.

    no I didn't....I wasn't aware that that I needed one. Would I need to deploy it just because I am trying to load a jpeg into a QPixmap?
    Thanks for your help!

  4. #4
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QPixmap not loading image(from file) after deployment.

    Quote Originally Posted by csmithmaui View Post
    no I didn't....I wasn't aware that that I needed one. Would I need to deploy it just because I am trying to load a jpeg into a QPixmap?
    Thanks for your help!
    Yes, according to this you do:
    http://doc.qt.nokia.com/4.6/deployme...tml#qt-plugins

  5. #5
    Join Date
    Feb 2010
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QPixmap not loading image(from file) after deployment.

    @schnitzel:
    Thanks very much, I included qjpeg4.dll in plugins/imageformats under my root, then added a qt.conf setup to use the plugin path. It worked fine. Thanks again!

    csmithmaui

Similar Threads

  1. image loading problem using qpixmap
    By dutt_004 in forum Qt Programming
    Replies: 4
    Last Post: 23rd February 2010, 01:18
  2. Getting image file from QPixmap
    By di_zou in forum Qt Programming
    Replies: 2
    Last Post: 5th October 2009, 16:20
  3. Loading a QPixmap from raw data
    By pherthyl in forum Qt Programming
    Replies: 1
    Last Post: 27th January 2008, 10:12
  4. Loading jpeg (QPixmap with Qt Jambi)
    By Mr_Blonde in forum Qt Programming
    Replies: 4
    Last Post: 14th September 2006, 18:06
  5. Loading a custom image into a QPixmap
    By KShots in forum Qt Programming
    Replies: 12
    Last Post: 5th August 2006, 00:16

Tags for this Thread

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.