From 091e8413d5610403931033e9786f2d60ce7af9df Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Thu, 12 Jan 2023 17:35:02 +0100 Subject: [PATCH] Forgot to save the image --- books.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/books.py b/books.py index a2c4587..be4c8d4 100644 --- a/books.py +++ b/books.py @@ -59,8 +59,10 @@ class MyChapter(Chapter): if img.attrib["src"].startswith("http"): img.getparent().remove(img) else: - image = Image.open(f"{path.dirname(image_dir)}/{img.attrib['src']}") + src = f"{path.dirname(image_dir)}/{img.attrib['src']}" + image = Image.open(src) image.thumbnail((1000, 2000)) + image.save(src) def async_wrap(func):