Deployed program fails to load JPEG
-
Again: please find a way to catch the debug outputs (e.g. with qInstallMessageHandler) so we can see what QT_DEBUG_PLUGINS prints out!
wrote on 30 Sept 2020, 13:08 last edited by@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()
-
Please take a look at QCoreApplication::libraryPaths(), it's the source where Qt iterates over: QFactoryLoader::update()
wrote on 30 Sept 2020, 14:02 last edited by... 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.
-
Lifetime Qt Championwrote on 30 Sept 2020, 15:16 last edited by 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.
-
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.
wrote on 30 Sept 2020, 15:43 last edited by closer_exDid 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 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.
wrote on 30 Sept 2020, 17:03 last edited byOk,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!
-
wrote on 21 May 2024, 07:51 last edited by dp69
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.