Allow signaling issues in label verification
This commit is contained in:
1 parent
3754c0c11a
commit
9925362352
21 files changed
+1347
-36
No files matched your search
@@ -237,7 +237,7 @@ import json
|
||||
|
||||
|
||||
def get_single_image_bytes(pdf_path):
|
||||
"""Converts a multi-page PDF into a single stitched JPEG in memory."""
|
||||
"""Convert PDF pages into a single JPEG, centering pages within the widest."""
|
||||
imgs = convert_from_path(pdf_path, dpi=200) # Same DPI as grouping.py
|
||||
if not imgs:
|
||||
raise ValueError(f"No pages in {pdf_path}")
|
||||
@@ -250,7 +250,7 @@ def get_single_image_bytes(pdf_path):
|
||||
combined = Image.new('RGB', (max_width, total_height), 'white')
|
||||
y_offset = 0
|
||||
for img in imgs:
|
||||
combined.paste(img, (0, y_offset))
|
||||
combined.paste(img, ((max_width - img.width) // 2, y_offset))
|
||||
y_offset += img.height
|
||||
|
||||
img_byte_arr = io.BytesIO()
|
||||
|
||||
Reference in new issue
Block a user