Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.3.2
-
None
-
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
- relates to
-
QTBUG-68787 Image files with wrong, but known, file name extension fail to load
- Closed
For Gerrit Dashboard: QTBUG-42540 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
249788,6 | Fix loading of image files with wrong, but known, file name extension | dev | qt/qtbase | Status: MERGED | +2 | 0 |