qt5base-lts/tests/auto/gui/image/qicoimageformat
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
..
icons Make the ICO image handler capable of reading CUR files too. 2014-06-05 19:10:58 +02:00
.gitignore Moved gui autotests into new directory structure 2011-09-01 10:59:49 +02:00
qicoimageformat.pro QtGui: Remove Windows CE. 2016-03-30 17:35:41 +00:00
qicoimageformat.qrc Android: Fix qicoimageformat test. 2014-12-22 08:34:05 +01:00
tst_qicoimageformat.cpp Fix loading of image files with wrong, but known, file name extension 2019-07-18 16:05:57 +02:00