Skip to content

Commit 5acfd8d

Browse files
committed
Patch image behavior
1 parent 17d49ee commit 5acfd8d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

chandra/output.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ def extract_images(html: str, chunks: dict, image: Image.Image):
3030
if not img:
3131
continue
3232
bbox = chunk["bbox"]
33-
block_image = image.crop(bbox)
33+
try:
34+
block_image = image.crop(bbox)
35+
except ValueError:
36+
# Happens when bbox coordinates are invalid
37+
continue
3438
img_name = get_image_name(html, div_idx)
3539
images[img_name] = block_image
3640
return images

chandra/scripts/templates/screenshot.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@
137137
padding: 30px;
138138
line-height: 1.6;
139139
color: #333;
140+
font-size: 24px;
140141
}
141142

142143
.markdown-content h1, .markdown-content h2, .markdown-content h3 {

0 commit comments

Comments
 (0)