Results 1 to 20 of 24

Thread: imageformats plugins

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2007
    Posts
    47
    Thanks
    34
    Qt products
    Qt4
    Platforms
    Windows

    Default imageformats plugins

    Hi,

    I followed the Qt centre instructions and I copied everything from QT's "plugins/imageformats" into my "C:/my_qt_compiling_directory/imageformats" and recompiled my program but still my program cannot handle image files. Do I need to make some changes to the project file? Or maybe I'm missing somethig else. Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: imageformats plugins

    It doesn't matter where the imageformats are when you compile the application. It matters where they are when you run it. If you run it on a computer that has Qt installed, they should work fine regardless where you place the application binary. When you deploy on another machine they have to be where the FAQ states.

  3. The following user says thank you to wysota for this useful post:

    ht1 (5th January 2008)

  4. #3
    Join Date
    Nov 2007
    Posts
    47
    Thanks
    34
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: imageformats plugins

    Thanks Wysota,

    When I run my program on a machine that doesn't have Qt installed and I put the image plugins in the folder suggested in the FAQ, they still don't function. Is there a way to statically link these plugins to my exe file during compilation somehow?

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: imageformats plugins

    If you have their static versions compiled, then yes. But I suggest to take a look at why the plugins are not working for you. Verify it is really related to the plugins by loading a PNG image that doesn't use a plugin. Do it exactly the same way you do for other images. At best just replace a ".jpg" with ".png" in your application code and replace the JPEG image with a PNG one.

  6. The following user says thank you to wysota for this useful post:

    ht1 (5th January 2008)

  7. #5
    Join Date
    Nov 2007
    Posts
    47
    Thanks
    34
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: imageformats plugins

    Thansk again, Wysota,

    I know that my program is OK because it works with BMP (and not with TIFF, GIF or JPG) images on the computer that does not have Qt4 installed and it works with all images on the computer that has Qt4 installed.

    How could I obtain/compile static versions of the imageformats dll files. Linking them to my exe seems like the best solution to me.

  8. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: imageformats plugins

    Quote Originally Posted by ht1 View Post
    Thansk again, Wysota,

    I know that my program is OK because it works with BMP (and not with TIFF, GIF or JPG) images on the computer that does not have Qt4 installed and it works with all images on the computer that has Qt4 installed.
    What does this small program return on either of the machines?

    Qt Code:
    1. #include <QtGui>
    2. #include <QtDebug>
    3.  
    4. int main(int argc, char **argv){
    5. QApplication app(argc, argv);
    6. foreach(const QByteArray &fmt, QImageReader::supportedImageFormats()){
    7. qDebug() << QString(fmt);
    8. }
    9. return 0;
    10. }
    To copy to clipboard, switch view to plain text mode 

    How could I obtain/compile static versions of the imageformats dll files. Linking them to my exe seems like the best solution to me.
    You need to reconfigure and rebuild Qt. configure -help will show you the proper options.

  9. The following user says thank you to wysota for this useful post:

    ht1 (5th January 2008)

  10. #7
    Join Date
    Nov 2007
    Posts
    47
    Thanks
    34
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: imageformats plugins

    Hi Wysota.

    I ran your test program on the machine that has Qt4 but I did not detect anything happening at all. Is this program supposed to list the file extentions supported?

    In order to compile imageformats dll files I have to reconfigure Qt in on my computer??That sounds a bit complicated for my current knowledge but I'd like to try it. Are there any step by step instructions available?

  11. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: imageformats plugins

    Quote Originally Posted by ht1 View Post
    I ran your test program on the machine that has Qt4 but I did not detect anything happening at all.
    Add CONFIG+=console to the project file, rerun qmake and rebuild the project.

    Is this program supposed to list the file extentions supported?
    Yes.

    In order to compile imageformats dll files I have to reconfigure Qt in on my computer??
    Yes.

    That sounds a bit complicated for my current knowledge
    So use the shared versions. They are much less complicated and you still haven't verified they are the ones causing trouble. Do that first before trying more tedious options like the one below.

    Are there any step by step instructions available?
    configure -help then configure <your set of switches go here> and then mingw-make or whatever your make command is.

  12. The following user says thank you to wysota for this useful post:

    ht1 (5th January 2008)

  13. #9
    Join Date
    Nov 2007
    Posts
    47
    Thanks
    34
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: imageformats plugins

    Thanks again, Wysota, I got your test program to work now.

    The computer that does not have Qt4 recognizes bmp, pbm, pgm, png, ppm, xbm, xpm as image files. The list is not getting longer when I put all the Qt image dll files in the "imageformats" folder.
    The computer that has Qt4 recognizes all 14 file formats as image files.
    So, what's your professional verdict? What do you think could be wrong? Many thanks!

  14. #10
    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: imageformats plugins

    Quote Originally Posted by ht1 View Post
    The list is not getting longer when I put all the Qt image dll files in the "imageformats" folder.
    Could you post the full paths to that folder and the executable? Is that application compiled in release mode?

  15. The following user says thank you to jacek for this useful post:

    ht1 (7th January 2008)

  16. #11
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: imageformats plugins

    Quote Originally Posted by ht1 View Post
    So, what's your professional verdict?
    My professional verdict is that your image plugins are not loaded.

    What do you think could be wrong?
    You are probably mixing debug and release mode files, you have missing dependencies or your paths are incorrect. I suspect Jacek will want to suggest at least one of the three right after you answer his questions.

    Oh, and I'd like to add one more question to his few - Could you list the exact file names of Qt libraries you have deployed on the target machine?

  17. The following user says thank you to wysota for this useful post:

    ht1 (7th January 2008)

  18. #12
    Join Date
    Nov 2007
    Posts
    47
    Thanks
    34
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: imageformats plugins

    Wysota and Jacek, your recommendations were very good and I was able to get my program to work. Thanks! Mixed up paths was the problem.

    I'd like to pursue trying to put everytihing (all the dll files) into one exe file. I understand that I have 2 options:
    1) reconfigure my mingw
    2) obtain static versions of these dll files

    I played with reconfiguring and did not get very far. I am not sure what the configuration options are that I need to use. Has anybody recently done this with mingw? I'd be very thankful for your help.
    The second question is about obtaining these static versions of the dll files. How?

Similar Threads

  1. Qt Plugins Error
    By nathanpackard in forum Qt Programming
    Replies: 1
    Last Post: 17th August 2007, 23:19
  2. Nightmares with plugins
    By KShots in forum Qt Programming
    Replies: 6
    Last Post: 8th February 2007, 16:46
  3. Qt plugins - how to do a libtool-style autoload
    By KShots in forum Qt Programming
    Replies: 2
    Last Post: 7th February 2007, 12:40
  4. Arthur Plugins demos and designer
    By antonio.r.tome in forum Installation and Deployment
    Replies: 4
    Last Post: 21st March 2006, 14:01
  5. Plugins as small application
    By blackliteon in forum Qt Programming
    Replies: 4
    Last Post: 12th January 2006, 09:39

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.