engrharis commited on
Commit
b3e8dad
·
verified ·
1 Parent(s): 9eeb86b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -20,7 +20,9 @@ def generate_pdf(images_with_sequence):
20
 
21
  pdf = FPDF()
22
  for i, (image, _) in enumerate(images_with_sequence):
23
- image.save(f"temp_image_{i}.jpg")
 
 
24
  pdf.add_page()
25
  pdf.image(f"temp_image_{i}.jpg", x=10, y=10, w=190)
26
 
 
20
 
21
  pdf = FPDF()
22
  for i, (image, _) in enumerate(images_with_sequence):
23
+ if image.mode != 'RGB':
24
+ image = image.convert('RGB')
25
+ image.save(f"temp_image_{i}.jpg", "JPEG")
26
  pdf.add_page()
27
  pdf.image(f"temp_image_{i}.jpg", x=10, y=10, w=190)
28