mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-04-28 17:57:16 +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()
|
||||
|
||||
# Make sure the thumbnail directory exists before writing into it
|
||||
os.makedirs(ThumbnailCache.thumbnailDir, exist_ok=True)
|
||||
try:
|
||||
os.makedirs(ThumbnailCache.thumbnailDir, exist_ok=True)
|
||||
except OSError:
|
||||
logging.warning(f'[ThumbnailCache] Failed to create directory: {ThumbnailCache.thumbnailDir}')
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def clean():
|
||||
|
@ -218,6 +222,9 @@ class ThumbnailCache(QObject):
|
|||
if not imgSource.isValid():
|
||||
return None
|
||||
|
||||
if not os.path.exists(ThumbnailCache.thumbnailDir):
|
||||
return imgSource
|
||||
|
||||
imgPath = imgSource.toLocalFile()
|
||||
path = ThumbnailCache.thumbnailPath(imgPath)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue