compute %width% and %height% in filepath when saving

This commit is contained in:
m957ymj75urz 2023-03-26 13:10:20 +02:00
parent f5365c9c81
commit 8a35c12e8c
1 changed files with 7 additions and 0 deletions

View File

@ -746,6 +746,13 @@ class SaveImage:
except:
digits = 0
return (digits, prefix)
def compute_vars(input):
input = input.replace("%width%", str(images[0].shape[1]))
input = input.replace("%height%", str(images[0].shape[0]))
return input
filename_prefix = compute_vars(filename_prefix)
subfolder = os.path.dirname(os.path.normpath(filename_prefix))
filename = os.path.basename(os.path.normpath(filename_prefix))