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):