Hi,
I'm just wondering why QImage are consuming that much memory.
I'm loading an image that is 1.2 Mb (I checked that using QFileInfo) and when querying the size using sizeInBytes on the QImage I get something like 24 Mb. Any idea ?
What class can I use in order to load the image with the lowest size in memory (uncompressed), and to display it of course (I need to put it in a PixMap at the end in order to add it to a GraphicsScene) ?
Do you think I'm misinterpreting the value from QFileInfo ?
I can clearly see in the task manager, that my program consumes more memory than I think it should be.
qDebug
() <<
"INFO:" << info.
size() <<
" IMG BYTES: " <<
new QImage(imagePath
)->sizeInBytes
();
//INFO: 1277952 IMG BYTES: 24064000
QFileInfo info(imagePath);
qDebug() << "INFO:" << info.size() << " IMG BYTES: " << new QImage(imagePath)->sizeInBytes(); //INFO: 1277952 IMG BYTES: 24064000
To copy to clipboard, switch view to plain text mode
Thanks in advance !
Bookmarks