rnmee commited on
Commit
0d133f4
·
verified ·
1 Parent(s): 7231fdb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -219,12 +219,12 @@ def generate_pdf_report(original_img: Image.Image, mask: np.ndarray, overlay: Im
219
  # Helper function to add images
220
  def add_pdf_image(pdf, image, title):
221
  img_byte_arr = io.BytesIO()
222
- image.save(img_byte_arr, format='PNG')
 
223
  img_bytes = img_byte_arr.getvalue()
224
-
225
  pdf.set_font("helvetica", "B", 12)
226
  pdf.cell(text=title, new_x="LMARGIN", new_y="NEXT")
227
- pdf.image(io.BytesIO(img_bytes), x=10, w=180)
228
  pdf.ln(5)
229
 
230
  # Add images
 
219
  # Helper function to add images
220
  def add_pdf_image(pdf, image, title):
221
  img_byte_arr = io.BytesIO()
222
+ resized_img = image.resize((150, 150))
223
+ resized_img.save(img_byte_arr, format='PNG')
224
  img_bytes = img_byte_arr.getvalue()
 
225
  pdf.set_font("helvetica", "B", 12)
226
  pdf.cell(text=title, new_x="LMARGIN", new_y="NEXT")
227
+ pdf.image(io.BytesIO(img_bytes), x=10, w=100)
228
  pdf.ln(5)
229
 
230
  # Add images