|
|
@ -143,12 +143,17 @@ class ImageCache: |
|
|
|
# the string "//". There isn't much we can do with that, unless the user |
|
|
|
# the string "//". There isn't much we can do with that, unless the user |
|
|
|
# happens to have an unpacked copy lying around somewheres... |
|
|
|
# happens to have an unpacked copy lying around somewheres... |
|
|
|
path = Path(bl_image.filepath_from_user()) |
|
|
|
path = Path(bl_image.filepath_from_user()) |
|
|
|
if path.is_file(): |
|
|
|
try: |
|
|
|
cached_image.modify_time = path.stat().st_mtime |
|
|
|
exists = path.is_file() |
|
|
|
if cached_image.export_time and cached_image.export_time < cached_image.modify_time: |
|
|
|
except OSError: |
|
|
|
return None |
|
|
|
exists = False |
|
|
|
else: |
|
|
|
finally: |
|
|
|
cached_image.modify_time = 0 |
|
|
|
if exists: |
|
|
|
|
|
|
|
cached_image.modify_time = path.stat().st_mtime |
|
|
|
|
|
|
|
if cached_image.export_time and cached_image.export_time < cached_image.modify_time: |
|
|
|
|
|
|
|
return None |
|
|
|
|
|
|
|
else: |
|
|
|
|
|
|
|
cached_image.modify_time = 0 |
|
|
|
|
|
|
|
|
|
|
|
# ensure the data has been loaded from the cache |
|
|
|
# ensure the data has been loaded from the cache |
|
|
|
if cached_image.image_data is None: |
|
|
|
if cached_image.image_data is None: |
|
|
|