qt5base-lts/tests/auto/gui/image
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
..
qicoimageformat Fix loading of image files with wrong, but known, file name extension 2019-07-18 16:05:57 +02:00
qicon Introduce QIcon::fallbackSearchPaths() 2018-01-15 10:12:22 +00:00
qiconhighdpi qt_findAtNxFile(): account for .9 (9-patch image) extensions 2017-06-24 21:24:53 +00:00
qimage Migrate Windows system libs to external dependencies 2019-05-08 08:30:02 +00:00
qimageiohandler
qimagereader Merge remote-tracking branch 'origin/5.12' into dev 2019-06-25 13:04:27 +02:00
qimagewriter Add Grayscale16 Image Format 2018-12-12 22:26:49 +00:00
qmovie Fix a crash when QMovie::speed is set to 0 2018-01-24 10:13:00 +00:00
qpicture tst_qpicture: Remove dependency on widgets 2018-05-24 10:35:43 +00:00
qpixmap Migrate Windows system libs to external dependencies 2019-05-08 08:30:02 +00:00
qpixmapcache Remove usages of deprecated APIs of qtbase/gui 2019-07-13 10:43:15 +02:00
image.pro