From 2385d669231c8c3af3aab1ae31fa0e4c9f170f1e Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Mon, 22 May 2023 13:23:46 +0200 Subject: [PATCH] Image IO: increase the default allocation limit Time passes, Moore's law is working. As a drive-by, make the doc more informative. Fixes: QTBUG-113637 Pick-to: 6.5 Change-Id: Ic388b8850ace02c429d4d8175d31db86912d3afe Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/image/qimagereader.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp index 6208ae52c76..b2a95d70e46 100644 --- a/src/gui/image/qimagereader.cpp +++ b/src/gui/image/qimagereader.cpp @@ -463,7 +463,7 @@ public: static int maxAlloc; }; -int QImageReaderPrivate::maxAlloc = 128; // 128 MB is enough for an 8K 32bpp image +int QImageReaderPrivate::maxAlloc = 256; // 256 MB is enough for an 8K 64bpp image /*! \internal @@ -1572,6 +1572,8 @@ int QImageReader::allocationLimit() loading corrupt image files. It is normally not needed to change it. The default limit is large enough for all commonly used image sizes. + At runtime, this value may be overridden by the environment variable \c QT_IMAGEIO_MAXALLOC. + \note The memory requirements are calculated for a minimum of 32 bits per pixel, since Qt will typically convert an image to that depth when it is used in GUI. This means that the effective allocation limit is significantly smaller than \a mbLimit when reading 1 bpp and 8 bpp images.