Qt 6.2 QImage JPG over 33,547,526 pixels no longer loads
-
My image viewer program, updated from Qt 5.15.2 to Qt 6.2, no longer will display jpg files over 33.5 million pixels. I also tried the Qt example application "imageviewer", which has the same issue. Qt has a web page https://doc.qt.io/qt-6/qtimageformats-changes-qt6.html suggesting something has changed, but all the page has is "ADD STUFF HERE".
I determined it is a size issue by resizing an image down until it would work.
The point of failure is QImage::load function. QImage::loadFromData also fails.
-
Hi,
Can you provide a minimal compilable example along with such a file to show the issue ?
-
@SGaist said in Qt 6.2 QImage JPG over 33,547,526 pixels no longer loads:
Hi,
Can you provide a minimal compilable example along with such a file to show the issue ?
The imageviewer Qt example application. Any jpg greater than 33.6 million pixels.
Example jpg that does not work (8640x5760 pixels): https://drive.google.com/file/d/1ZwWEJCVP7Mdqtt_SWbEPHVm1a6HBnkri/view?usp=sharing
The same image, reduced in size to 7094x4729 pixels works: https://drive.google.com/file/d/1Jkpb2y527m066tGy1Y4O66Mcw8nhZ31Q/view?usp=sharing
-
Which OS are you on ?
-
See QImage::setAllocationLimit() and the warning output on your command line when you start your program:
qt.gui.imageio: QImageIOHandler: Rejecting image as it exceeds the current allocation limit of 128 megabytes
-
@Christian-Ehrlicher @hskoglund @SGaist Thanks very much gentlemen!