Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QML Image: Error decoding: data:image/jpeg;base64,
Forum Update on Monday, May 27th 2025

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

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 1.1k Views
  • 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.
  • S Offline
    S Offline
    steinito
    wrote on 2 May 2021, 16:21 last edited by
    #1

    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?

    S 1 Reply Last reply 2 May 2021, 16:59
    0
    • S steinito
      2 May 2021, 16:21

      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?

      S Offline
      S Offline
      steinito
      wrote on 2 May 2021, 16:59 last edited by
      #2

      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:"

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 2 May 2021, 18:13 last edited by
        #3

        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 ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0

        1/3

        2 May 2021, 16:21

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved