diff --git a/imageformats/sai.cpp b/imageformats/sai.cpp index f55aaa1..f4ba082 100644 --- a/imageformats/sai.cpp +++ b/imageformats/sai.cpp @@ -41,6 +41,10 @@ bool SAIHandler::canRead(QIODevice *device) QImageIOPlugin::Capabilities SAIPlugin::capabilities(QIODevice *device, const QByteArray &format) const { + if (format == "sai") { + return Capabilities(CanRead); + } + if (!format.isEmpty()) { return {}; } @@ -49,7 +53,11 @@ QImageIOPlugin::Capabilities SAIPlugin::capabilities(QIODevice *device, const QB return {}; } - return Capabilities(CanRead); + Capabilities cap; + if (device->isReadable() && SAIHandler::canRead(device)) { + cap |= CanRead; + } + return cap; } QImageIOHandler *SAIPlugin::create(QIODevice *device, const QByteArray &format) const