mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-12 15:52:07 +02:00
[ui] thumbnails: fallback if thumbnailDir could not be created
This commit is contained in:
parent
0c137a141f
commit
aca308dbf9
1 changed files with 8 additions and 1 deletions
|
@ -89,7 +89,11 @@ class ThumbnailCache(QObject):
|
||||||
ThumbnailCache.cleaningThread.start()
|
ThumbnailCache.cleaningThread.start()
|
||||||
|
|
||||||
# Make sure the thumbnail directory exists before writing into it
|
# Make sure the thumbnail directory exists before writing into it
|
||||||
|
try:
|
||||||
os.makedirs(ThumbnailCache.thumbnailDir, exist_ok=True)
|
os.makedirs(ThumbnailCache.thumbnailDir, exist_ok=True)
|
||||||
|
except OSError:
|
||||||
|
logging.warning(f'[ThumbnailCache] Failed to create directory: {ThumbnailCache.thumbnailDir}')
|
||||||
|
pass
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def clean():
|
def clean():
|
||||||
|
@ -218,6 +222,9 @@ class ThumbnailCache(QObject):
|
||||||
if not imgSource.isValid():
|
if not imgSource.isValid():
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
if not os.path.exists(ThumbnailCache.thumbnailDir):
|
||||||
|
return imgSource
|
||||||
|
|
||||||
imgPath = imgSource.toLocalFile()
|
imgPath = imgSource.toLocalFile()
|
||||||
path = ThumbnailCache.thumbnailPath(imgPath)
|
path = ThumbnailCache.thumbnailPath(imgPath)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue