how to get the picture's resolution, file's size quickly without open the file?
-
how to get the picture's resolution, file's size quickly without open the file?
i now use
QPixmap xxx(filePath);
int w = xxx.width();
int h = xxx.height();
...........
.........
as for file size, i use
QImage xxx(filePath);
int size = xxx.byteCount();
..........
.......... -
Hi,
IMO you can't, these information are stored in the image file so you MUST open it to read them.
-
but i found that it's very slow when there are lots of image file...
is there any accelaration method? -
Hi,
you could write a method that opens the file a reads only these information instead of loading all data.
But in this case you have to handle manually the binary data of the different image formats. -
ok, got it, thank you