Update app.py
Browse files
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.
|
|
|
|
| 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=
|
| 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
|