[ui] Viewer3D: do not load too large EXR files in 3D to avoid crashes in qt

This commit is contained in:
Fabien Castan 2020-09-14 21:50:43 +02:00
parent ce77d7b018
commit 2f77a236b3
2 changed files with 14 additions and 1 deletions

View file

@ -2,7 +2,7 @@
# coding:utf-8
from meshroom.core import pyCompatibility
from PySide2.QtCore import QUrl
from PySide2.QtCore import QUrl, QFileInfo
from PySide2.QtCore import QObject, Slot
import os
@ -89,3 +89,8 @@ class FilepathHelper(QObject):
if fileList:
return fileList[0]
return ""
@Slot(QUrl, result=int)
def fileSizeMB(self, path):
""" Returns the file size in MB. """
return QFileInfo(self.asStr(path)).size() / (1024*1024)