1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-08-07 07:56:30 +02:00

Fixed recently created bug trying to delete non-existent thumbnail diffs.

This commit is contained in:
Chris Palmer
2021-09-14 10:08:13 +01:00
parent ec49ce1a6c
commit 24b391578b

View File

@@ -72,7 +72,7 @@ def update_image(tmp_name, png_name):
if pixels < 0 or pixels > threshold: if pixels < 0 or pixels > threshold:
shutil.copyfile(tmp_name, png_name) shutil.copyfile(tmp_name, png_name)
print(Fore.YELLOW + png_name + " updated" + Fore.WHITE, pixels if pixels > 0 else '') print(Fore.YELLOW + png_name + " updated" + Fore.WHITE, pixels if pixels > 0 else '')
if png_name.endswith('_tn.png'): if png_name.endswith('_tn.png') and os.path.isfile(diff_name):
os.remove(diff_name) os.remove(diff_name)
else: else:
os.utime(png_name, None) os.utime(png_name, None)