big image preview optimisations, preview positioning fix, memory leaks fix

This commit is contained in:
Blue 2021-05-17 23:32:44 +03:00
parent 721f6daa36
commit ddfaa63a24
Signed by: blue
GPG key ID: 9B203B252A63EE38
4 changed files with 43 additions and 20 deletions

View file

@ -128,12 +128,12 @@ Shared::Global::FileInfo Shared::Global::getFileInfo(const QString& path)
QSize size;
if (big == "image") {
QMovie mov(path);
if (mov.isValid()) {
if (mov.isValid() && mov.frameCount() > 1) {
p = FileInfo::Preview::animation;
} else {
p = FileInfo::Preview::picture;
}
QImage img(path);
QImageReader img(path);
size = img.size();
// } else if (big == "video") {
// p = FileInfo::Preview::movie;