I have an application that displays alot of images of different file formats like svg, png and jpeg. My application runs fine when I run it in my build environment, but when I deploy it to a target PC, only svg and png images will load and the others get a QML Image: Unsupported Image Format.
The image objects are on the form
Image {
id: jpgimage
source: images/jpgimage.jpg
}
Image {
id: pngimage
source: images/pngimage.png
}
Image {
id: svgimage
source: images/svgimage.svg
}
I am deploying my application with this command:
windeployqt --dir <my target folder> --qmldir <path the my project qml folder> <path to my executable>.exe --compiler-runtime
This will load most of my required libraries, but I have to manually copy over some missing .dll files as well, that are not Qt specific.
My target folder now have these files and folders:
my_app.log Qt5Widgets.dll* libharfbuzz-0.dll*
Qt/ Qt5WinExtras.dll* libiconv-2.dll*
Qt5Core.dll* QtGraphicalEffects/ libicudt68.dll*
Qt5Gui.dll* QtMultimedia/ libicuin68.dll*
Qt5Multimedia.dll* QtQml/ libicuuc68.dll*
Qt5MultimediaQuick.dll* QtQuick/ libintl-8.dll*
Qt5Network.dll* QtQuick.2/ libpcre-1.dll*
Qt5Qml.dll* QtQuick3D/ libpcre2-16-0.dll*
Qt5QmlModels.dll* QtTest/ libpng16-16.dll*
Qt5QmlWorkerScript.dll* QtWinExtras/ libstdc++-6.dll*
Qt5Quick.dll* my_app.exe* libwinpthread-1.dll*
Qt5Quick3D.dll* audio/ libzstd.dll*
Qt5Quick3DAssetImport.dll* bearer/ mediaservice/
Qt5Quick3DRender.dll* iconengines/ platforminputcontexts/
Qt5Quick3DRuntimeRender.dll* imageformats/ platforms/
Qt5Quick3DUtils.dll* libbrotlicommon.dll* playlistformats/
Qt5QuickControls2.dll* libbrotlidec.dll* qmltooling/
Qt5QuickShapes.dll* libbz2-1.dll* styles/
Qt5QuickTemplates2.dll* libdouble-conversion.dll* translations/
Qt5QuickTest.dll* libfreetype-6.dll* virtualkeyboard/
Qt5RemoteObjects.dll* libgcc_s_seh-1.dll* zlib1.dll*
Qt5Svg.dll* libglib-2.0-0.dll*
Qt5Test.dll* libgraphite2.dll*
And my imageformats folder contains
qgif.dll* qico.dll* qjpeg.dll* qtga.dll* qwbmp.dll*
qicns.dll* qjp2.dll* qsvg.dll* qtiff.dll* qwebp.dll*
This is running on a Windows 10 PC, also built on Windows 10 using mingw64 and the qt library installed there via msys2, and the windeployqt executable used is also from mingw64.
The target PC is freshly installed and has no environment variables set, and the application runs and the svg and png images are shown, but not the jpg images.
I have had a few tries before getting a deployed application to work, so it is highly likely I am missing something obvious in this process.
*edit: I also tried adding debug output printing the library paths:
qDebug() << "QCoreApplication::libraryPaths(): " << QCoreApplication::libraryPaths();
This printed my target folder path (the one above containing my application and all the libraries).