fix(Qt6): don't set image allocation limit
User might needs to load large image which isn't corrupted, see GH-28 for example. This restores Qt 5's default behavior.
This commit is contained in:
parent
d80c661c66
commit
67762b357d
|
@ -40,6 +40,9 @@ void GraphicsView::showFileFromPath(const QString &filePath, bool doRequestGalle
|
||||||
QImageReader imageReader(filePath);
|
QImageReader imageReader(filePath);
|
||||||
imageReader.setAutoTransform(true);
|
imageReader.setAutoTransform(true);
|
||||||
imageReader.setDecideFormatFromContent(true);
|
imageReader.setDecideFormatFromContent(true);
|
||||||
|
#if QT_VERSION > QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
imageReader.setAllocationLimit(0);
|
||||||
|
#endif //QT_VERSION > QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
|
||||||
// Since if the image format / plugin does not support this feature, imageFormat() will returns an invalid format.
|
// Since if the image format / plugin does not support this feature, imageFormat() will returns an invalid format.
|
||||||
// So we cannot use imageFormat() and check if it returns QImage::Format_Invalid to detect if we support the file.
|
// So we cannot use imageFormat() and check if it returns QImage::Format_Invalid to detect if we support the file.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user