diff --git a/cache/f512418272.png b/cache/f512418272.png index 0ba6641..0c69c1e 100644 Binary files a/cache/f512418272.png and b/cache/f512418272.png differ diff --git a/demo.py b/demo.py index 4af88b8..5281843 100644 --- a/demo.py +++ b/demo.py @@ -117,10 +117,11 @@ def _cache_image(image, file_path): _open_image(newfname) -def _save_image(image, file_path, product_name): +def _save_image(file_path): + image = cv2.imread(file_path) opened_image_basename = os.path.basename(file_path) opened_image_path = os.path.dirname(file_path) - newfname = opened_image_path + '/' + product_name + '_' + opened_image_basename + newfname = opened_image_path + '/../' + opened_image_basename cv2.imwrite(newfname, image) print(f"Image saved as '{newfname}'.") _open_image(newfname) @@ -167,6 +168,7 @@ if __name__ == "__main__": file_menu = tk.Menu(menu, tearoff=0) menu.add_cascade(label="File", menu=file_menu) file_menu.add_command(label="Open Image", command=open_image) + file_menu.add_command(label="Save Image", command=lambda: _save_image(OPENED_IMAGE)) file_menu.add_command(label="Exit", command=root.quit) test_menu = tk.Menu(menu, tearoff=0) diff --git a/f512418272.png b/f512418272.png index 8959190..0c69c1e 100644 Binary files a/f512418272.png and b/f512418272.png differ