qt5base-lts/tests/auto/gui
Eirik Aavitsland 82aabafada Fix loading of image files with wrong, but known, file name extension
If QImageReader recognized the suffix of a file, it would by default
not check if the file contents matched the claimed format. Hence, a
valid but misnamed image file would fail to load.
Fix by adding contents check for suffix-recognized files.

[ChangeLog][QtGui][Image] Loading of image files having a file name
suffix for a different image file type has been fixed. QImageReader
will now ask the suffix format handler to confirm the file contents
(canRead()), and fall back to normal file content recognition on
failure. This implies a slight behavior change in
QImageReader::loopCount(), ::imageCount() and ::nextImageDelay(): For
an unreadable file with a recognized suffix, they would earlier return
0, while they now will return -1, i.e. error as per the documentation.

Fixes: QTBUG-42540
Fixes: QTBUG-68787
Change-Id: I205e83f29ed7190cbcae95dab960232544d012f6
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-07-18 16:05:57 +02:00
..
image Fix loading of image files with wrong, but known, file name extension 2019-07-18 16:05:57 +02:00
itemmodels Remove usages of deprecated APIs of corelib 2019-07-05 11:25:46 +02:00
kernel Remove usages of deprecated APIs of qtbase/gui 2019-07-13 10:43:15 +02:00
math3d Remove usages of deprecated APIs of qtbase/gui 2019-07-13 10:43:15 +02:00
painting Remove usages of deprecated APIs of qtbase/gui 2019-07-13 10:43:15 +02:00
qopengl unblacklist passing tests 2019-07-08 11:01:42 +00:00
qopenglconfig Deprecate conversion functions between QList and QSet 2019-05-07 14:15:44 +00:00
qvulkan Merge remote-tracking branch 'origin/5.10' into dev 2017-10-17 10:34:24 +02:00
rhi Introduce the Qt graphics abstraction as private QtGui helpers 2019-06-13 10:13:45 +02:00
text Remove usages of deprecated APIs of qtbase/gui 2019-07-13 10:43:15 +02:00
util Remove usages of deprecated APIs of qtbase/gui 2019-07-13 10:43:15 +02:00
gui.pro Introduce the Qt graphics abstraction as private QtGui helpers 2019-06-13 10:13:45 +02:00