0

Trying to load a 105 Mb (31349X26982 pixels) image to a QImage or QPixmap using this code :

QImage m("/home/user/Desktop/a.jpg");

and

QPixmap m("/home/user/Desktop/a.jpg");

both fails to load the image with no debugging information in Qt Creator.

No warnings / errors appear. When trying to show it in a label, the label is empty.

Using Qt 5.7 on ubuntu 16.04, with qt creator 4.0.2 and gcc 7.1

Any suggestions?

secretgenes
  • 1,291
  • 1
  • 19
  • 39
JLev
  • 705
  • 1
  • 9
  • 30
  • 2
    If QT decompresses the image then 31349 * 26982 * 32 / 8 = 3,383,434,872 bytes approx 3,226 Gb – Richard Critten Aug 09 '17 at 13:36
  • Damn it, thank you – JLev Aug 09 '17 at 13:37
  • @Ron No, according to the accepted answer, the size limit for images in Qt is 32767x32767, which is larger than the OP's image. – Donald Duck Aug 09 '17 at 14:37
  • @DonaldDuck It is the image dimension times the bytes per pixel that makes up the total bytes allowed. Not just the dimension. – Ron Aug 09 '17 at 15:26
  • 3G pixmap in label? I know the modern displays have insane resolutions, but stil... something like 512x512 should be enough for icon at the moment (a bit of sarcasm, I guess the "label" was just debugging quick-hack and the image is not to end as "icon" in the end... when I was for example working on games and we had something like that as background under level, with 1:1 scale (i.e. only small part is visible), usually we used some kind of tiling, storing several tiles separately and dynamically loading only the nearest of them, similar to how web maps works today in aerial view)). – Ped7g Aug 09 '17 at 16:35

0 Answers0