diff --git a/imageformatplugins/dci/qdciiohandler.cpp b/imageformatplugins/dci/qdciiohandler.cpp index f7c17613..c47ae691 100644 --- a/imageformatplugins/dci/qdciiohandler.cpp +++ b/imageformatplugins/dci/qdciiohandler.cpp @@ -49,7 +49,8 @@ bool QDciIOHandlerPrivate::load(QIODevice *device) if (loaded) return current; if (q->format().isEmpty()) - return false; + q->canRead(); + loaded = true; QBuffer *buf = qobject_cast(device); @@ -95,7 +96,6 @@ QDciIOHandler::QDciIOHandler() } - QDciIOHandler::~QDciIOHandler() { delete d; @@ -110,6 +110,10 @@ bool QDciIOHandler::canRead() const QByteArray buf = device()->peek(4); if (buf.startsWith(QByteArrayLiteral("DCI"))) { + // Decide format from content.. + if (format().isEmpty()) + setFormat("dci"); + return true; } return false;