Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-42540

QML Image element doesn't use magic bytes for image type identification

    XMLWordPrintable

Details

    • 82aabafadad2010f0f20abeeb7234057e3c10e9f (qt/qtbase/dev)

    Description

      QML Image element defines the image type by the extension passed to it in the source. This creates problems when, for example, one tries to load a PNG image named with a file extension of .jpg. File extensions should never be trusted in the first place.

      Example of an error produced when doing this:

      Not a JPEG file: starts with 0x89 0x50
      qrc:///*****.qml:*:: QML Image: Invalid image data: ******...

      Desired solution:
      1) QML Engine uses the magic bytes in the passed file and loads proper image decoder based on that information, and maybe in addition
      2) ability to change QML Engines behavior with additional property to QML Image element, f.ex. "useMagicBytes: true" (defaults to false)

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              brakke Mikael Bragge
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes