Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QML Image: Error decoding: data:image/jpeg;base64,



  • Hi,

    I have a qml application running in windows 10, build with mingw with 5.15.2.
    A part of the application has a QML Image object that takes a base64 string as an image source.
    The base 64 string is on the form "data:image/jpeg;base64,/9j/4 ......and a looooong string that follows after this.
    The string has also been tested in many online base64 converters and it is indeed the image I have encoded.
    The application runs fine in my build environment, I build the Makefile with cmake -G "MinGW Makefiles", and build the application with the "mingw32-make -j12" command.
    The issue is that I cannot get this to work on a target PC I deploy the application to.
    I deploy it using the windeployqt tool, and the entire application runs as expected, but when I try to load these base64 strings as sources for my QML Image objects, I get the
    "QML Image: Error decoding: data:image/jpeg;base64,<rest of the base64 string>" error code.

    Any idea what I can do to fix this?



  • I have also tried removing the "data:image/jpeg;base64," part of the base64 string, but then I get this error: "QML Image: Cannot open: qrc:"


  • Lifetime Qt Champion

    Hi,

    Can you explain exactly what you did to deploy your application ?

    Does it run successfully on your machine outside of Qt Creator once you deployed it ?


Log in to reply