Deployed program fails to load JPEG
-
We need the debug output from the system where the plugins are not loaded.
-
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... -
Again: please find a way to catch the debug outputs (e.g. with qInstallMessageHandler) so we can see what QT_DEBUG_PLUGINS prints out!
-
@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.
-
Please take a look at QCoreApplication::libraryPaths(), it's the source where Qt iterates over: QFactoryLoader::update()
-
... 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.
-
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.
-
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, addedinclude <QImageReader>
andQImageReader::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?
-
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.
-
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!
-
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.