Page 3 of 3 FirstFirst 123
Results 41 to 47 of 47

Thread: QWebView doesn't show JPEG images on a clean XP machine

  1. #41
    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: QWebView doesn't show JPEG images on a clean XP machine

    Quote Originally Posted by mentalmushroom View Post
    I didn't build it.
    So please open the Visual Studio command prompt and build your application from within the command line, as requested.

    If something is done wrong in Qt binaries, I hope it to be fixed. Otherwise, I'd like to know how to run those samples, because as you can see it is not that easy to run when Visual C++ Redistributable is not installed.
    Strangely it works for thousands if not millions of people but not you. Probably Qt binaries have a special "if" block detecting your machine so that loading images fails on your machines only.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #42
    Join Date
    Feb 2011
    Posts
    354
    Thanks
    17
    Thanked 27 Times in 24 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default Re: QWebView doesn't show JPEG images on a clean XP machine

    Ok, I've built it. It works with the same result. By the way, I am wondering why should I rebuild Qt samples, aren't those binaries correct?

    Strangely it works for thousands if not millions of people but not you. Probably Qt binaries have a special "if" block detecting your machine so that loading images fails on your machines only.
    I think, most people use it along with Visual C++ Redistributable package, so they don't have this problem, or even with some another compiler. Unfortunately, I can't use redistributable package.

    I extracted manifest from imageviewer.exe:
    Qt Code:
    1. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    2. <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    3. <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    4. <security>
    5. <requestedPrivileges>
    6. <requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel>
    7. </requestedPrivileges>
    8. </security>
    9. </trustInfo>
    10. <dependency>
    11. <dependentAssembly>
    12. <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" publicKeyToken="6595b64144ccf1df" language="*" processorArchitecture="*"></assemblyIdentity>
    13. </dependentAssembly>
    14. </dependency>
    15. <dependency>
    16. <dependentAssembly>
    17. <assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
    18. </dependentAssembly>
    19. </dependency>
    20. </assembly>
    To copy to clipboard, switch view to plain text mode 

    Here goes manifest from crt folder:
    Qt Code:
    1. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    2. <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    3. <noInheritable></noInheritable>
    4. <assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
    5. <file name="msvcr90.dll" hashalg="SHA1" hash="98e8006e0a4542e69f1a3555b927758bd76ca07d"><asmv2:hash xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>+CXED+6HzJlSphyMNOn27ujadC0=</dsig:DigestValue></asmv2:hash></file> <file name="msvcp90.dll" hashalg="SHA1" hash="3aec3be680024a46813dee891a753bd58b3f3b12"><asmv2:hash xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>MyKED+9DyS+1XcMeaC0Zlw2vFZ0=</dsig:DigestValue></asmv2:hash></file> <file name="msvcm90.dll" hashalg="SHA1" hash="0195dd0896d74b62531e4f3c771904a3d996450e"><asmv2:hash xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>EeyDE7og6WoPd2oBhYbMEnpFHhY=</dsig:DigestValue></asmv2:hash></file>
    6. </assembly>
    To copy to clipboard, switch view to plain text mode 

  3. #43
    Join Date
    Dec 2009
    Posts
    128
    Thanks
    7
    Thanked 14 Times in 14 Posts
    Platforms
    Unix/X11 Windows

    Default Re: QWebView doesn't show JPEG images on a clean XP machine

    Quote Originally Posted by mentalmushroom View Post
    I think, most people use it along with Visual C++ Redistributable package, so they don't have this problem, or even with some another compiler. Unfortunately, I can't use redistributable package.
    Why so ?
    From Qt docs (here) it seems it's necessary; not sure you have the choice

  4. #44
    Join Date
    Feb 2011
    Posts
    354
    Thanks
    17
    Thanked 27 Times in 24 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default Re: QWebView doesn't show JPEG images on a clean XP machine

    It is possible to distribute the application with crt folder. But in my case I have to distribute imageformats folder also and those plugins don't work unless I include crt folder duplicate inside.

  5. #45
    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: QWebView doesn't show JPEG images on a clean XP machine

    Quote Originally Posted by mentalmushroom View Post
    Ok, I've built it. It works with the same result. By the way, I am wondering why should I rebuild Qt samples, aren't those binaries correct?


    I think, most people use it along with Visual C++ Redistributable package, so they don't have this problem, or even with some another compiler. Unfortunately, I can't use redistributable package.
    The problem is with your machine and with your machine only. There is a trio here that needs access to the C runtime:
    1) Qt libs
    2) Qt plugins
    3) your application

    Furthermore Qt plugins depend on Qt libs. If all those components required the same C runtime, you'd only need one runtime. If they somehow require different runtimes then they have not been built using the same settings. Furthermore if Qt libs and Qt plugins require a different runtime then apparently they haven't been built together. You can see that in QtSDK where there are loads of plugins for Creator (which is built with MSVC), there is no runtime in each plugin directory and strangely enough everything works fine even on a "clean XP" machine. I don't know what you did, I don't know how you deployed your program to the target machine but apparently you didn't do it correctly. That's the whole story and putting the blame on Qt libraries is a silly thing to do. After all you don't need a copy of Qt libs in the "imageformats" directory even though the plugins depend on Qt, right? So where is the difference between plugins requiring Qt libs and plugins requiring the C runtime? Welcome to DLL hell!

    Here is a fragment of the docs you should read too:
    Visual Studio 2008 And Manual Installs

    As well as the above details for VS 2005 and onwards, Visual Studio 2008 applications may have problems when deploying manually, say to a USB stick.

    The recommended procedure is to configure Qt with the -plugin-manifests option using the 'configure' tool. Then follow the guidelines for manually deploying private assemblies.

    In brief the steps are

    create a folder structure on the development computer that will match the target USB stick directory structure, for example '\app' and for your dlls, '\app\lib'.
    on the development computer, from the appropriate 'redist' folder copy over Microsoft.VC80.CRT and Microsoft.VC80.MFC to the directories '\app' and '\app\lib' on the development PC.
    xcopy the \app folder to the target USB stick.

    Your application should now run. Also be aware that even with a service pack installed the Windows DLLs that are linked to will be the defaults. See the information on how to select the appropriate target DLLs.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #46
    Join Date
    Feb 2011
    Posts
    354
    Thanks
    17
    Thanked 27 Times in 24 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default Re: QWebView doesn't show JPEG images on a clean XP machine

    The problem is with your machine and with your machine only
    No, I tried it on a different machine. It was a different computer with a different version of XP. Only it was on the virtual machine also, but I think it should not cause problems, because I tried both VMWare and VirtualBox.

    I don't know what you did, I don't know how you deployed your program to the target machine but apparently you didn't do it correctly.
    Well, I told you several times how I did it, even posted screenshots yesterday. I installed Qt binaries downloaded from Qt site and copied demo application along with imageformats and crt folder. Yes, I understand very well it should work without imageformats inside each directory, but the problem is it doesn't work otherwise.

    The recommended procedure is to configure Qt with the -plugin-manifests option using the 'configure' tool
    I guess this can be done when you build qt yourself. I use ready-made binaries, but as long as they are intended to be used with visual studio, I think it should be configured properly.

    create a folder structure on the development computer that will match the target USB stick directory structure, for example '\app' and for your dlls, '\app\lib'.
    on the development computer, from the appropriate 'redist' folder copy over Microsoft.VC80.CRT and Microsoft.VC80.MFC to the directories '\app' and '\app\lib' on the development PC.
    xcopy the \app folder to the target USB stick.
    I think, I did what was said here, but I didn't copy mfc directory. As long as it works without it when I include crt inside imageformats, I think mfc is not needed.

    Perhaps all test systems I tried were incorrectly configured or I did something wrong in deploying, I would be highly appreciated if somebody could show how to do it right. I think for those who also use compiled binaries from qt site it is not that much work to try, because enough is to test the demo application (e.g. imageviewer). But important thing is the target system (XP) should be clean without vcredist and other optional software.
    Last edited by mentalmushroom; 12th August 2011 at 16:09.

  7. #47
    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: QWebView doesn't show JPEG images on a clean XP machine

    Quote Originally Posted by mentalmushroom View Post
    Well, I told you several times how I did it, even posted screenshots yesterday.
    I know a picture can speak one thousand words, but definitely not in this case.

    I guess this can be done when you build qt yourself. I use ready-made binaries, but as long as they are intended to be used with visual studio, I think it should be configured properly.
    So stick to the rules and deploy dependencies properly.

    I think, I did what was said here, but I didn't copy mfc directory. As long as it works without it when I include crt inside imageformats, I think mfc is not needed.
    I have no idea why this section of docs mentions MFC. "Just in case", probably. Nevertheless you didn't teach your bundle to look for the crt in a proper directory.

    Perhaps all test systems I tried were incorrectly configured or I did something wrong in deploying, I would be highly appreciated if somebody could show how to do it right.
    Launch vcredist install from your installer, use a different compiler, build Qt yourself or deploy your application statically. The choice is yours to make. Unfortunately Windows deployment model sucks but we all have to live with it.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. QPixMap doesn't show one of two images !
    By ladiesfinger in forum Qt Programming
    Replies: 5
    Last Post: 10th January 2011, 17:29
  2. Replies: 10
    Last Post: 9th September 2010, 17:43
  3. Replies: 2
    Last Post: 22nd March 2010, 09:54
  4. Problem with displaying jpeg and gif images, in QT4
    By node_ex in forum Installation and Deployment
    Replies: 1
    Last Post: 23rd September 2008, 16:29
  5. JPEG Images not shown in QiconView using QT3??
    By darpan in forum Qt Programming
    Replies: 1
    Last Post: 4th August 2006, 21:34

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.