mirror of
https://github.com/datalab-to/chandra.git
synced 2025-12-03 02:23:10 +00:00
Patch image behavior
This commit is contained in:
@@ -30,7 +30,11 @@ def extract_images(html: str, chunks: dict, image: Image.Image):
|
||||
if not img:
|
||||
continue
|
||||
bbox = chunk["bbox"]
|
||||
block_image = image.crop(bbox)
|
||||
try:
|
||||
block_image = image.crop(bbox)
|
||||
except ValueError:
|
||||
# Happens when bbox coordinates are invalid
|
||||
continue
|
||||
img_name = get_image_name(html, div_idx)
|
||||
images[img_name] = block_image
|
||||
return images
|
||||
|
||||
@@ -137,6 +137,7 @@
|
||||
padding: 30px;
|
||||
line-height: 1.6;
|
||||
color: #333;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.markdown-content h1, .markdown-content h2, .markdown-content h3 {
|
||||
|
||||
Reference in New Issue
Block a user