Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QPixmap load fails on WinXP SP3?
Forum Updated to NodeBB v4.3 + New Features

QPixmap load fails on WinXP SP3?

Scheduled Pinned Locked Moved General and Desktop
15 Posts 4 Posters 10.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    windyweather
    wrote on last edited by
    #1

    I wrote a small photo resizer program and it works fine on Win Vista and Win 7, but fails to read the JPG files on Win XP Sp3.
    https://sourceforge.net/projects/photoresizerqt/

    Look in files and choose the Windows Installer, or examine the source.

    I do not have access to WinXP all the time, so it will be some time before I can run a debugger on such a system, but my friends need this resizer and can't use it since it fails.

    Any ideas? Strange error don't you think.
    BTW, I thought it might be a limitation with image size, so I tried a small image [800pix] on the Win XP system and that failed too, so just looks like a system incompatibility in the library.

    Thanks,
    Windy

    1 Reply Last reply
    0
    • ZlatomirZ Offline
      ZlatomirZ Offline
      Zlatomir
      wrote on last edited by
      #2

      I looks that you forgot about the Qt's jpeg plug-in, so have you included it in the installation package?
      "doc":http://doc.qt.nokia.com/latest/deployment-windows.html#creating-the-application-package on how to create the deployment package on windows.

      I think the file is in Qt_SDK_INSTALL_DIR\qt\plugins\imageformats and it's called qjpeg4.dll and you should copy it in a folder called plugins that should be in the folder where you install the application, but i didn't have to deploy an application with plug-ins, so this is just my opinion, please correct me if i'm wrong

      https://forum.qt.io/category/41/romanian

      1 Reply Last reply
      0
      • G Offline
        G Offline
        goetz
        wrote on last edited by
        #3

        I looked at the InnoSetup script. You should add the image format plugins to your installer package.

        You should add this to your InnoSetup script:

        @

        Source: C:\Code\PhotoResizerQt-build-desktop\release\plugins\imageformats\qgif4.dll; DestDir: {app}\plugins\imageformats; Flags: ignoreversion
        Source: C:\Code\PhotoResizerQt-build-desktop\release\plugins\imageformats\qico4.dll; DestDir: {app}\plugins\imageformats; Flags: ignoreversion
        Source: C:\Code\PhotoResizerQt-build-desktop\release\plugins\imageformats\qjpeg4.dll; DestDir: {app}\plugins\imageformats; Flags: ignoreversion
        Source: C:\Code\PhotoResizerQt-build-desktop\release\plugins\imageformats\qmng4.dll; DestDir: {app}\plugins\imageformats; Flags: ignoreversion
        Source: C:\Code\PhotoResizerQt-build-desktop\release\plugins\imageformats\qsvg4.dll; DestDir: {app}\plugins\imageformats; Flags: ignoreversion
        Source: C:\Code\PhotoResizerQt-build-desktop\release\plugins\imageformats\qtiff4.dll; DestDir: {app}\plugins\imageformats; Flags: ignoreversion
        @

        Are you really sure your Qt libs are in "C:\Code\PhotoResizerQt-build-desktop\release"? That seems to be the build directory of your application, not the install dir of the Qt libs.

        http://www.catb.org/~esr/faqs/smart-questions.html

        1 Reply Last reply
        0
        • W Offline
          W Offline
          windyweather
          wrote on last edited by
          #4

          Ok. I spaced that...
          When I ran the app with a double click from the release folder, of course some DLLs were missing.
          Soooo... I figured that when I resolved all of those, I had it ready to go. I'll check into this.

          I test to make sure I have all the DLLs I need by copying them to the Release folder. When the app runs I figure I have all that I need and then I build the installer from there. Looks like either I didn't completely test the app from the release folder or it found the plugins anyway.

          Thanks,
          windy

          1 Reply Last reply
          0
          • G Offline
            G Offline
            goetz
            wrote on last edited by
            #5

            The plug ins are loaded from either the Qt installation dir or from the plugins folder near the application executable. So your app runs fine on the development machine because the plug ins are found in the Qt dir.

            http://www.catb.org/~esr/faqs/smart-questions.html

            1 Reply Last reply
            0
            • W Offline
              W Offline
              windyweather
              wrote on last edited by
              #6

              Woops...
              This does not work.
              I installed the program on a Vista x64 system where Qt has not been installed and it fails.
              The plugins are as you suggest. But no dice.

              Based on this page: http://doc.qt.nokia.com/latest/plugins-howto.html
              It looks like I can statically link against the plugins, so I'm going to try that next.

              • windy
              1 Reply Last reply
              0
              • G Offline
                G Offline
                goetz
                wrote on last edited by
                #7

                For my projects it is sufficient to include this into the InnoSetup script:

                @
                #define QtDir "C:\Qt\4.7.0"

                Source: {#QtDir}\bin\QtCore4.dll; DestDir: {app}; Flags: ignoreversion
                Source: {#QtDir}\bin\QtGui4.dll; DestDir: {app}; Flags: ignoreversion

                Source: {#QtDir}\plugins\iconengines\qsvgicon4.dll; DestDir: {app}\plugins\iconengines; Flags: ignoreversion

                Source: {#QtDir}\plugins\imageformats\qgif4.dll; DestDir: {app}\plugins\imageformats; Flags: ignoreversion
                Source: {#QtDir}\plugins\imageformats\qico4.dll; DestDir: {app}\plugins\imageformats; Flags: ignoreversion
                Source: {#QtDir}\plugins\imageformats\qjpeg4.dll; DestDir: {app}\plugins\imageformats; Flags: ignoreversion
                Source: {#QtDir}\plugins\imageformats\qmng4.dll; DestDir: {app}\plugins\imageformats; Flags: ignoreversion
                Source: {#QtDir}\plugins\imageformats\qsvg4.dll; DestDir: {app}\plugins\imageformats; Flags: ignoreversion
                Source: {#QtDir}\plugins\imageformats\qtiff4.dll; DestDir: {app}\plugins\imageformats; Flags: ignoreversion
                @

                Does the program actually start on the other windows box? If not you should check if the C++ runtimes are installed there.

                http://www.catb.org/~esr/faqs/smart-questions.html

                1 Reply Last reply
                0
                • ZlatomirZ Offline
                  ZlatomirZ Offline
                  Zlatomir
                  wrote on last edited by
                  #8

                  Make sure the installer copy the dll's in proper folder settings, because your project works for me (on Xp without Qt)
                  take a look here: !http://i.imgur.com/wjgXC.jpg(http://i.imgur.com/wjgXC.jpg)!
                  LE: Looks like the folder imageformats should be directly in the same folder as the application, not in the plugins folder.

                  https://forum.qt.io/category/41/romanian

                  1 Reply Last reply
                  0
                  • W Offline
                    W Offline
                    windyweather
                    wrote on last edited by
                    #9

                    Maybe. Or you can qApp.addLibraryPath( qApp.applicationDirPath + QString("/plugins") ); and put them in plugins/imageformats.

                    When I copied them manually to the app dir, it did not work under Vista x64. Not sure why.
                    But this method works under Vista x64. Now for a Win 7 x64 test.

                    Yep. Works fine on Win 7 x64 too.

                    • windy
                    1 Reply Last reply
                    0
                    • G Offline
                      G Offline
                      goetz
                      wrote on last edited by
                      #10

                      the plugins must be in a subdir plugins/imageformats - this is per default in the library search path, it should not be necessary to add it manually.

                      http://www.catb.org/~esr/faqs/smart-questions.html

                      1 Reply Last reply
                      0
                      • ZlatomirZ Offline
                        ZlatomirZ Offline
                        Zlatomir
                        wrote on last edited by
                        #11

                        @Volker: i though the same, but the default behavior seem to be imageformats folder direct in the same folder as application (it doesn't work if i put them in the plugins/imageformats) //see the print-screen above - that's on a brand-new installation of Xp, i just built an Xp machine to test my apps, no Qt installed yet ;)

                        https://forum.qt.io/category/41/romanian

                        1 Reply Last reply
                        0
                        • W Offline
                          W Offline
                          windyweather
                          wrote on last edited by
                          #12

                          So I guess we agree that Nokia or TrollTech or whoever needs to update the docs to make this more clear. Seems that they have not covered all the bases re the Deployment of applications.
                          Thanks for your help,
                          windy

                          1 Reply Last reply
                          0
                          • G Offline
                            G Offline
                            goetz
                            wrote on last edited by
                            #13

                            Oh yes, you're right Zlatomir. My fault, sorry. It is necessary to add the dir to the plugins path.

                            http://www.catb.org/~esr/faqs/smart-questions.html

                            1 Reply Last reply
                            0
                            • G Offline
                              G Offline
                              goetz
                              wrote on last edited by
                              #14

                              Windy, that's all explained in the "Deploying an Application on Windows":http://doc.trolltech.com/stable/deployment-windows.html page of the docs, there's a dedicated section regarding the "Qt plugins":http://doc.trolltech.com/latest/deployment-windows.html#qt-plugins at the end.

                              http://www.catb.org/~esr/faqs/smart-questions.html

                              1 Reply Last reply
                              0
                              • M Offline
                                M Offline
                                mohsen
                                wrote on last edited by
                                #15

                                have you tested your application with same compiled libraries in WindowsXP SP2? If you did, so it would be a Qt bug. You may report it.

                                1 Reply Last reply
                                0

                                • Login

                                • Login or register to search.
                                • First post
                                  Last post
                                0
                                • Categories
                                • Recent
                                • Tags
                                • Popular
                                • Users
                                • Groups
                                • Search
                                • Get Qt Extensions
                                • Unsolved