From f87f5d0a77ef66025d90b1ce756cdbf415ba28ec Mon Sep 17 00:00:00 2001 From: JonatanRek Date: Sat, 5 Oct 2024 22:38:58 +0200 Subject: [PATCH] Fix --- app.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index ddf5155..0b578d0 100644 --- a/app.py +++ b/app.py @@ -54,7 +54,13 @@ try: i = i +1 extension = img_path[img_path.index(".")+1:] - new_img_path = img_path.replace((".{}".format(extension)), ('_anonym.{}'.format(extension))) + + new_img_path = img_path + if (not img_path.endswith(('_anonym.{}'.format(extension)))): + new_img_path = img_path.replace((".{}".format(extension)), ('_anonym.{}'.format(extension))) + else: + print("Path already anonymized !!!") + cv2.imwrite(new_img_path, img) data = {