January 1, 2011

windyweather windyweather
Lab Rat
12 posts

QPixmap load fails on WinXP SP3?

 

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

14 replies

January 1, 2011

Zlatomir Zlatomir
Robot Herder
229 posts

I looks that you forgot about the Qt’s jpeg plug-in, so have you included it in the installation package?
doc [doc.qt.nokia.com] 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

January 1, 2011

Volker Volker
Mad Scientist
5250 posts

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:

  1. Source: C:\Code\PhotoResizerQt-build-desktop\release\plugins\imageformats\qgif4.dll; DestDir: {app}\plugins\imageformats; Flags: ignoreversion
  2. Source: C:\Code\PhotoResizerQt-build-desktop\release\plugins\imageformats\qico4.dll; DestDir: {app}\plugins\imageformats; Flags: ignoreversion
  3. Source: C:\Code\PhotoResizerQt-build-desktop\release\plugins\imageformats\qjpeg4.dll; DestDir: {app}\plugins\imageformats; Flags: ignoreversion
  4. Source: C:\Code\PhotoResizerQt-build-desktop\release\plugins\imageformats\qmng4.dll; DestDir: {app}\plugins\imageformats; Flags: ignoreversion
  5. Source: C:\Code\PhotoResizerQt-build-desktop\release\plugins\imageformats\qsvg4.dll; DestDir: {app}\plugins\imageformats; Flags: ignoreversion
  6. 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.

January 1, 2011

windyweather windyweather
Lab Rat
12 posts

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

January 1, 2011

Volker Volker
Mad Scientist
5250 posts

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.

January 1, 2011

windyweather windyweather
Lab Rat
12 posts

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

January 1, 2011

Volker Volker
Mad Scientist
5250 posts

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

  1. #define QtDir "C:\Qt\4.7.0"
  2.  
  3. Source: {#QtDir}\bin\QtCore4.dll; DestDir: {app}; Flags: ignoreversion
  4. Source: {#QtDir}\bin\QtGui4.dll; DestDir: {app}; Flags: ignoreversion
  5.  
  6. Source: {#QtDir}\plugins\iconengines\qsvgicon4.dll; DestDir: {app}\plugins\iconengines; Flags: ignoreversion
  7.  
  8. Source: {#QtDir}\plugins\imageformats\qgif4.dll; DestDir: {app}\plugins\imageformats; Flags: ignoreversion
  9. Source: {#QtDir}\plugins\imageformats\qico4.dll; DestDir: {app}\plugins\imageformats; Flags: ignoreversion
  10. Source: {#QtDir}\plugins\imageformats\qjpeg4.dll; DestDir: {app}\plugins\imageformats; Flags: ignoreversion
  11. Source: {#QtDir}\plugins\imageformats\qmng4.dll; DestDir: {app}\plugins\imageformats; Flags: ignoreversion
  12. Source: {#QtDir}\plugins\imageformats\qsvg4.dll; DestDir: {app}\plugins\imageformats; Flags: ignoreversion
  13. 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.

January 1, 2011

Zlatomir Zlatomir
Robot Herder
229 posts

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
LE: Looks like the folder imageformats should be directly in the same folder as the application, not in the plugins folder.

January 1, 2011

windyweather windyweather
Lab Rat
12 posts

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 ×64 test.

Yep. Works fine on Win 7 ×64 too.

- windy

January 2, 2011

Volker Volker
Mad Scientist
5250 posts

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.

January 2, 2011

Zlatomir Zlatomir
Robot Herder
229 posts

@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 ;)

January 2, 2011

windyweather windyweather
Lab Rat
12 posts

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

January 2, 2011

Volker Volker
Mad Scientist
5250 posts

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

January 2, 2011

Volker Volker
Mad Scientist
5250 posts

Windy, that’s all explained in the Deploying an Application on Windows [doc.trolltech.com] page of the docs, there’s a dedicated section regarding the Qt plugins [doc.trolltech.com] at the end.

January 2, 2011

Mohsen Mohsen
Robot Herder
347 posts

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.

 Signature 

www.madagon.com

 
  ‹‹ [Please recommend] Tutorial on how to use Widgets      Dynamically Syntax Highlighter ››

You must log in to post a reply. Not a member yet? Register here!