Fix lanczos

This commit is contained in:
Vik Paruchuri
2025-10-26 10:38:04 -04:00
parent 2d2d7ab331
commit 358358134e
2 changed files with 3 additions and 1 deletions

View File

@@ -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

View File

@@ -71,6 +71,8 @@ def parse_html(
else:
img = BeautifulSoup(f"<img src='{img_src}'/>", "html.parser")
div.append(img)
# Wrap text content in <p> tags if no inner HTML tags exist
if label in ["Text"] and not re.search(
"<.+>", str(div.decode_contents()).strip()
):