Details
-
Bug
-
Resolution: Invalid
-
P3: Somewhat important
-
None
-
5.9.1
-
None
-
The problem occurs on at least Linux (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 "<?xml".
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/1159
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 is the start of an svg tag ("<svg ") present in the first few lines? - before returning a positive value.
Attachments
Issue Links
- duplicates
-
QTBUG-63515 QImageReader::canRead(), incorrectly returning true for any string starting with "BMS"
-
- Closed
-
For Gerrit Dashboard: QTBUG-63568 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
208853,3 | Doc: add hint about QMimeDatabase to QImageReader::canRead() | 5.9 | qt/qtbase | Status: MERGED | +2 | 0 |