Skip to content

Commit

Permalink
updated image insertion
Browse files Browse the repository at this point in the history
  • Loading branch information
srugano committed Jun 12, 2024
1 parent 66e5f79 commit 6420d49
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/hope_country_report/apps/power_query/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ def insert_special_image(
rect, page_index = get_field_rect(document, field_name)
if rect:
image_stream = insert_special_language_image(text, rect, language, font_size=font_size, font_color=font_color)
img_rect = fitz.Rect(rect.x0, rect.y0, rect.x1, rect.y1)
img_rect = fitz.Rect(*rect)
page = document[page_index]
page.add_image_annot(img_rect, stream=image_stream)
page.insert_image(img_rect, stream=image_stream, keep_proportion=False)
else:
print(f"Field {field_name} not found") # Debugging line
logger.info(f"Field {field_name} not found")

0 comments on commit 6420d49

Please sign in to comment.