pixmap.loadfromdata fails using QT6.6.1
-
I can load and save png and jpg files just fine. Please provide a minimal, compilable example of your problem (as you wrote the db is not needed) including the probelmatic picture.
-
There were no detailed errors thrown. Only fail to load error from "loadfromdata()".
I did try using Qt6.7.0 but has same problem.
The image files were to large to upload so providing links to share.
This image link fails to load:
https://www.dropbox.com/scl/fi/ufh0905yhpbzlwmh6hsgd/file_fails_to_load.png?rlkey=p6q6w1aeay6qe9toueg7nm6ux&dl=0This image link loads successfully:
https://www.dropbox.com/scl/fi/lokdl52uhgzzz2asrvvob/file_loads_succesfully.png?rlkey=5tbz2jw83rpg0rs6k5wfo7d97&dl=0This image link fails to load:
https://www.dropbox.com/scl/fi/nf4m764boohn3at538u2t/file2_fails_to_load.png?rlkey=hdpnz0nu5jap0alqfix4alr6o&dl=0 -
I did just notice when not using debug mode on QtCreator the error message appears after load attempt.
qt.gui.imageio: QImageIOHandler: Rejecting image as it exceeds the current allocation limit of 256 megabytes
Was there a change in Qt6 that might have caused this?
-
-
@Christian-Ehrlicher
This seems like it is only for QImageReader. Am I wrong on that. While I could use the this class I would have to figure out how to get bytes from the database read into it. -
@rschnic said in pixmap.loadfromdata fails using QT6.6.1:
This seems like it is only for QImageReader
Every image in Qt is read with QImageReader.
-
Not to sound like a complete moron but I have found nothing in the QPixMap or QImage classes that would let me adjust that setting.
-
@rschnic
? The void QImageReader::setAllocationLimit(int mbLimit) is astatic
, which @Christian-Ehrlicher says will affect all reads of image files, no matter where they emanate from. Did you try it for your case? Or it says you can just set environment variableQT_IMAGEIO_MAXALLOC
instead. -