QImage not opening 16-bit png (AFAICT)
-
In my code I have this:
pQImage = std::make_shared<QImage>(name); // load the file if (pQImage->isNull()) // If it failed ... { ZTRACE_RUNTIME("Failed to load file into QImage"); pQImage.reset(); return false; }
It works just fine to load 8 bit jpeg and png files but when I try to feed it a 16 bit png it triggers the isNull() logic path.
Further to the above I now know what's wrong!
qt.gui.imageio: QImageIOHandler: Rejecting image as it exceeds the current allocation limit of 128 megabytes
The png file is from a fairly normal DSLR camera, with a sensor size of 5184x3888 so my arithmetic says for RGBA64 at 4*2 bytes per pixel, that is 161,243,136 bytes, so a bit over 153MB (real ones, not decimal ones). A large sensor these days is about 4 times larger than that so that's 600MB or so and there are MUCH larger ones than that. I have PNG files of 14557 x 8418 px at 16 bit depth (so about 950MB) - I think you need to raise your limit to at LEAST 1GB!
Is there any way for me to override that limit?
Thanks
David -
In my code I have this:
pQImage = std::make_shared<QImage>(name); // load the file if (pQImage->isNull()) // If it failed ... { ZTRACE_RUNTIME("Failed to load file into QImage"); pQImage.reset(); return false; }
It works just fine to load 8 bit jpeg and png files but when I try to feed it a 16 bit png it triggers the isNull() logic path.
Further to the above I now know what's wrong!
qt.gui.imageio: QImageIOHandler: Rejecting image as it exceeds the current allocation limit of 128 megabytes
The png file is from a fairly normal DSLR camera, with a sensor size of 5184x3888 so my arithmetic says for RGBA64 at 4*2 bytes per pixel, that is 161,243,136 bytes, so a bit over 153MB (real ones, not decimal ones). A large sensor these days is about 4 times larger than that so that's 600MB or so and there are MUCH larger ones than that. I have PNG files of 14557 x 8418 px at 16 bit depth (so about 950MB) - I think you need to raise your limit to at LEAST 1GB!
Is there any way for me to override that limit?
Thanks
David -
P Perdrix has marked this topic as solved on