mirror of
https://github.com/datalab-to/chandra.git
synced 2025-12-02 10:03:10 +00:00
Fix lanczos
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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()
|
||||
):
|
||||
|
||||
Reference in New Issue
Block a user