From 358358134e76deb0bbb132c12feae168da4a1ec1 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Sun, 26 Oct 2025 10:38:04 -0400 Subject: [PATCH] Fix lanczos --- chandra/input.py | 2 +- chandra/output.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/chandra/input.py b/chandra/input.py index 18eac00..0d793a7 100644 --- a/chandra/input.py +++ b/chandra/input.py @@ -18,7 +18,7 @@ def load_image(filepath: str): if image.width < settings.MIN_IMAGE_DIM or image.height < settings.MIN_IMAGE_DIM: scale = settings.MIN_IMAGE_DIM / min(image.width, image.height) new_size = (int(image.width * scale), int(image.height * scale)) - image = image.resize(new_size, Image.LANCZOS) + image = image.resize(new_size, Image.Resampling.LANCZOS) return image diff --git a/chandra/output.py b/chandra/output.py index 0d0b6bf..7d4d1c6 100644 --- a/chandra/output.py +++ b/chandra/output.py @@ -71,6 +71,8 @@ def parse_html( else: img = BeautifulSoup(f"", "html.parser") div.append(img) + + # Wrap text content in

tags if no inner HTML tags exist if label in ["Text"] and not re.search( "<.+>", str(div.decode_contents()).strip() ):