Details
-
Bug
-
Resolution: Duplicate
-
P2: Important
-
None
-
5.9.1
-
None
-
The problem occurs on at least Windows (unsure of version) and OSX 10.11.6, using Qt 5.9.1.
Description
QImageReader::canRead(), is supposed to be a reasonably fast method of determining if a buffer contains image data.
It seems to be setting the bar a little low though for how in depth it's checking, as it's incorrectly returning `true` for any buffer sequence starting with "BMS".
We have an open bug reported by one of our users, where their valid (non-image) data starts with that string. QImageReader::canRead() is incorrectly reporting that as an image file, without looking any further:
https://github.com/sqlitebrowser/sqlitebrowser/issues/1138
This causes problems, as our application relies on that return code to determine which data viewer to use. When canRead() gets it wrong above, that causes things to go down a wrong path.
It should probably do a bit more checking (eg can a resolution be read?) before returning a positive value.
Attachments
Issue Links
- is duplicated by
-
QTBUG-63568 QImageReader::canRead(), incorrectly returning true for any string starting with "<?xml"
-
- Closed
-
For Gerrit Dashboard: QTBUG-63515 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
207418,1 | Avoid false positives in the BMP handler's canRead() check | 5.9 | qt/qtbase | Status: ABANDONED | 0 | 0 |