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. Deployed program fails to load JPEG
Forum Updated to NodeBB v4.3 + New Features

Deployed program fails to load JPEG

Scheduled Pinned Locked Moved Solved General and Desktop
28 Posts 6 Posters 3.9k Views 2 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.
  • Christian EhrlicherC Offline
    Christian EhrlicherC Offline
    Christian Ehrlicher
    Lifetime Qt Champion
    wrote on last edited by
    #18

    We need the debug output from the system where the plugins are not loaded.

    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
    Visit the Qt Academy at https://academy.qt.io/catalog

    C 1 Reply Last reply
    0
    • Christian EhrlicherC Christian Ehrlicher

      We need the debug output from the system where the plugins are not loaded.

      C Offline
      C Offline
      closer_ex
      wrote on last edited by
      #19

      @Christian-Ehrlicher

      The following lines are missing:

      ModLoad: 00007ffe`eef80000 00007ffe`eef8d000   F:\Qt\5.15.0\msvc2019_64\plugins\imageformats\qgif.dll
      ModLoad: 00007ffe`e3130000 00007ffe`e313f000   F:\Qt\5.15.0\msvc2019_64\plugins\imageformats\qicns.dll
      ModLoad: 00007ffe`de440000 00007ffe`de44d000   F:\Qt\5.15.0\msvc2019_64\plugins\imageformats\qico.dll
      ModLoad: 00007ffe`d8bd0000 00007ffe`d8c3a000   F:\Qt\5.15.0\msvc2019_64\plugins\imageformats\qjpeg.dll
      ModLoad: 00007ffe`de430000 00007ffe`de43c000   F:\Qt\5.15.0\msvc2019_64\plugins\imageformats\qsvg.dll
      ModLoad: 00007ffe`de3b0000 00007ffe`de404000   F:\Qt\5.15.0\msvc2019_64\bin\Qt5Svg.dll
      ModLoad: 00007ffe`de370000 00007ffe`de37c000   F:\Qt\5.15.0\msvc2019_64\plugins\imageformats\qtga.dll
      ModLoad: 00007ffe`cf660000 00007ffe`cf6c3000   F:\Qt\5.15.0\msvc2019_64\plugins\imageformats\qtiff.dll
      ModLoad: 00007ffe`d8bc0000 00007ffe`d8bcb000   F:\Qt\5.15.0\msvc2019_64\plugins\imageformats\qwbmp.dll
      ModLoad: 00007ffe`cf5d0000 00007ffe`cf653000   F:\Qt\5.15.0\msvc2019_64\plugins\imageformats\qwebp.dll
      

      Right before qwindows.dll.
      I compared 2 outputs, other lines are the same except some loading sequence. No clue why Qt5Svg is not loaded though...

      1 Reply Last reply
      0
      • Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #20

        Again: please find a way to catch the debug outputs (e.g. with qInstallMessageHandler) so we can see what QT_DEBUG_PLUGINS prints out!

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        C 1 Reply Last reply
        0
        • Christian EhrlicherC Christian Ehrlicher

          Again: please find a way to catch the debug outputs (e.g. with qInstallMessageHandler) so we can see what QT_DEBUG_PLUGINS prints out!

          C Offline
          C Offline
          closer_ex
          wrote on last edited by
          #21

          @Christian-Ehrlicher
          The message handler somehow started to log plugins debug info.

          Debug: QFactoryLoader::QFactoryLoader() checking directory path "F:/cutexg music/platforms" ...
          Debug: QFactoryLoader::QFactoryLoader() looking at "F:/cutexg music/platforms/qminimal.dll"
          Warning: Found metadata in lib F:/cutexg music/platforms/qminimal.dll, metadata=
          {
              "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
              "MetaData": {
                  "Keys": [
                      "minimal"
                  ]
              },
              "archreq": 0,
              "className": "QMinimalIntegrationPlugin",
              "debug": false,
              "version": 331520
          }
          
          
          Debug: Got keys from plugin meta data ("minimal")
          Debug: QFactoryLoader::QFactoryLoader() looking at "F:/cutexg music/platforms/qwindows.dll"
          Warning: Found metadata in lib F:/cutexg music/platforms/qwindows.dll, metadata=
          {
              "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
              "MetaData": {
                  "Keys": [
                      "windows"
                  ]
              },
              "archreq": 0,
              "className": "QWindowsIntegrationPlugin",
              "debug": false,
              "version": 331520
          }
          
          
          Debug: Got keys from plugin meta data ("windows")
          Debug: loaded library "F:/cutexg music/platforms/qwindows.dll"
          Debug: QFactoryLoader::QFactoryLoader() checking directory path "F:/cutexg music/platformthemes" ...
          Debug: QFactoryLoader::QFactoryLoader() checking directory path "F:/cutexg music/styles" ...
          Debug: QFactoryLoader::QFactoryLoader() looking at "F:/cutexg music/styles/qwindowsvistastyle.dll"
          Warning: Found metadata in lib F:/cutexg music/styles/qwindowsvistastyle.dll, metadata=
          {
              "IID": "org.qt-project.Qt.QStyleFactoryInterface",
              "MetaData": {
                  "Keys": [
                      "windowsvista"
                  ]
              },
              "archreq": 0,
              "className": "QWindowsVistaStylePlugin",
              "debug": false,
              "version": 331520
          }
          
          
          Debug: Got keys from plugin meta data ("windowsvista")
          Debug: loaded library "F:/cutexg music/styles/qwindowsvistastyle.dll"
          Debug: QFactoryLoader::QFactoryLoader() checking directory path "F:/cutexg music/accessible" ...
          Debug: QFactoryLoader::QFactoryLoader() checking directory path "F:/cutexg music/accessiblebridge" ...
          

          Indicating it's not even looking for the imageformats.

          1 Reply Last reply
          0
          • Christian EhrlicherC Offline
            Christian EhrlicherC Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #22

            Please take a look at QCoreApplication::libraryPaths(), it's the source where Qt iterates over: QFactoryLoader::update()

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            C 1 Reply Last reply
            1
            • Christian EhrlicherC Christian Ehrlicher

              Please take a look at QCoreApplication::libraryPaths(), it's the source where Qt iterates over: QFactoryLoader::update()

              C Offline
              C Offline
              closer_ex
              wrote on last edited by
              #23

              @Christian-Ehrlicher

              ...
              QApplication a(argc, argv);
              qDebug() << QCoreApplication::libraryPaths() << Qt::endl;
              ...
              

              Lists only the root folder, "F:/cutexg music".

              Then I tried to add an absolute path directing to MSVC plugins folder by QApplication::addLibraryPath("F:\\Qt\\5.15.0\\msvc2019_64\\plugins");

              It lists both paths and pictures are shown. Plugins debug info also indicates the plugins from MSVC folder are loaded.

              1 Reply Last reply
              0
              • Christian EhrlicherC Offline
                Christian EhrlicherC Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on last edited by Christian Ehrlicher
                #24

                Ok, this does not help, did not read carefully enough.
                Please check the output of QImageReader::supportedImageFormats(). Did you maybe compile Qt by your own and disabled the image format plugins (QT_NO_IMAGEFORMATPLUGIN)?

                /edit: im referring to https://code.woboq.org/qt5/qtbase/src/gui/image/qimagereaderwriterhelpers.cpp.html#_ZN25QImageReaderWriterHelpers21supportedImageFormatsENS_10CapabilityE - as you can see calling supportedImageFormats() should trigger the QFactoryLoader for imageformats should be called.

                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                Visit the Qt Academy at https://academy.qt.io/catalog

                C 1 Reply Last reply
                1
                • Christian EhrlicherC Christian Ehrlicher

                  Ok, this does not help, did not read carefully enough.
                  Please check the output of QImageReader::supportedImageFormats(). Did you maybe compile Qt by your own and disabled the image format plugins (QT_NO_IMAGEFORMATPLUGIN)?

                  /edit: im referring to https://code.woboq.org/qt5/qtbase/src/gui/image/qimagereaderwriterhelpers.cpp.html#_ZN25QImageReaderWriterHelpers21supportedImageFormatsENS_10CapabilityE - as you can see calling supportedImageFormats() should trigger the QFactoryLoader for imageformats should be called.

                  C Offline
                  C Offline
                  closer_ex
                  wrote on last edited by closer_ex
                  #25

                  @Christian-Ehrlicher

                  Did you maybe compile Qt by your own and disabled the image format plugins (QT_NO_IMAGEFORMATPLUGIN)?

                  I install Qt by maintenance tool online, so this is unlikely to happen.

                  /edit: im referring to https://code.woboq.org/qt5/qtbase/src/gui/image/qimagereaderwriterhelpers.cpp.html#_ZN25QImageReaderWriterHelpers21supportedImageFormatsENS_10CapabilityE - as you can see calling supportedImageFormats() should trigger the QFactoryLoader for imageformats should be called.

                  This is absolutely weird, so I commented QApplication::addLibraryPath("F:\\Qt\\5.15.0\\msvc2019_64\\plugins"); out, added include <QImageReader> and QImageReader::supportedImageFormats() in main, deployed program showed jpeg again, even after I comment all these added lines then clean&rebuild the project. The library path output is still the same, but now it looks for and loads image plugins.

                  Now I'm really curious about what's going on, is this related to the shadow build or what?

                  1 Reply Last reply
                  0
                  • Christian EhrlicherC Offline
                    Christian EhrlicherC Offline
                    Christian Ehrlicher
                    Lifetime Qt Champion
                    wrote on last edited by
                    #26

                    Ok,what Qt version do you use and can you maybe provide a simple reproducer? I mean something like

                    int main(...)
                    {
                      QApplication app(argc, argv);
                      QImage img("my.jpeg");
                      qDebug() << "Is loaded:" << !img.isNull();
                    }
                    

                    So we can check if this small program has the same issues.

                    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                    Visit the Qt Academy at https://academy.qt.io/catalog

                    C 1 Reply Last reply
                    1
                    • Christian EhrlicherC Christian Ehrlicher

                      Ok,what Qt version do you use and can you maybe provide a simple reproducer? I mean something like

                      int main(...)
                      {
                        QApplication app(argc, argv);
                        QImage img("my.jpeg");
                        qDebug() << "Is loaded:" << !img.isNull();
                      }
                      

                      So we can check if this small program has the same issues.

                      C Offline
                      C Offline
                      closer_ex
                      wrote on last edited by
                      #27

                      @Christian-Ehrlicher

                      Ok,what Qt version do you use and can you maybe provide a simple reproducer?

                      I'm using Qt 5.15.0 with Qt Creator 4.13.1, compiler version is MSVC 2019 (16.7.30517.126 amd64).

                      I'll try to write a minimum example, but it may take some time to reproduce the situation. Thanks very much for your effort and patience!

                      1 Reply Last reply
                      0
                      • D Offline
                        D Offline
                        dp69
                        wrote on last edited by dp69
                        #28

                        Hello from 2024, I believe I had the same issue loading JPEG plugin, while other (GIF ICO) loaded correctly.

                        It is insufficient to have "imageformats" with the "qjpeg(d).dll" in it. You also need to have "jpeg62.dll" in your application folder, i.e. next to other basic "Qt6*.dll". The missing "jpeg62.dll" corresponds to JPEG image codec (https://libjpeg-turbo.org/) that Qt JPEG plugin depends on.

                        I hope that helps.

                        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