Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.6.0
-
None
-
-
1b0f4df30 (dev), b3fa83462 (6.7), 63abfd6dd (6.6)
Description
Hi,
Since a recent update to Qt 6.6 I'm having issues loading ICNS files when the allocation limit is disabled. Here is a test code loading an ICNS file with allocation limit disabled and saving it as JPEG:
#include <QCoreApplication> #include <QImageReader> #include <QFileInfo> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QString filename = "/path/to/sample.icns"; QImageReader reader(filename); reader.setAllocationLimit(0); QImage img; reader.read(&img); img.save("/path/to/sample.jpg"); return 0; }
I also attaches a sample.icns file I used in my testing. When I run the above code as is with the allocation limit set to 0, then I get this error message and no resulting jpeg file:
maximum memory limit (0) would be exceeded Jasper thread initialization failed QICNSHandler::read(): Failed, compressed format "jp2" is not supported by your Qt library or this file is corrupt. OSType: "ic08"
If I change the allocation limit to something greater than 0 (or remove it altogether), then the above error message disappears and the file is successfully saved as jpeg file.
I tested some other file types and the behavior of QImageReader was as expected, I only observed this issue with ICNS files.
Attachments
For Gerrit Dashboard: QTBUG-118797 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
516741,5 | Fix allocation limit checking bug in jp2 handler | dev | qt/qtimageformats | Status: MERGED | +2 | 0 |
524887,2 | Fix allocation limit checking bug in jp2 handler | 6.7 | qt/qtimageformats | Status: MERGED | +2 | 0 |
524945,2 | Fix allocation limit checking bug in jp2 handler | 6.6 | qt/qtimageformats | Status: MERGED | +2 | 0 |