Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.3.1
-
None
-
OSX
Description
If you try this QML code
import QtQuick 2.1 Rectangle { width: 360 height: 360 AnimatedImage { anchors.centerIn: parent source: "http://libmng.com/MNGsuite/images/T01SCRL.mng" } }
it works, but it displays the warning
QICNSHandler::canRead() called on a sequential device
That's coming from here
bool QICNSHandler::canRead(QIODevice *device) { if (!device || !device->isReadable()) { qWarning("QICNSHandler::canRead() called without a readable device"); return false; } if (device->isSequential()) { qWarning("QICNSHandler::canRead() called on a sequential device"); return false; } return device->peek(4) == QByteArrayLiteral("icns"); }
If the goal is just to read the first 4 bytes, it should be possible to do that even on a sequential device, and find some way to cache them for later. Perhaps a caching wrapper stream of some sort. Then the warning would not be necessary.
It's interesting that the ICNS plugin got invoked for MNG images though, isn't it? I guess it just checks to see if it canRead() and then tries another plugin. But you could put an icns file on a web server if you like, so this could maybe come up somewhere legitimately...
But if a lot of plugins will need to read some bytes in their canRead() functions, it's inefficient to query the first few bytes from the server repeatedly. Maybe we need another solution then.
Attachments
Issue Links
- resulted from
-
QTBUG-39217 Animated image loaded from network produces warnings
-
- Closed
-