rosemariafontana commited on
Commit
4c1b460
Β·
verified Β·
1 Parent(s): 3152d9a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -42,7 +42,8 @@ def parse_ticket_image(image, question):
42
  # Processing the image
43
  if image:
44
  try:
45
- document = Image.open(image.name).convert("RGB")
 
46
  except Exception as e:
47
  traceback.print_exc()
48
  error = str(e)
 
42
  # Processing the image
43
  if image:
44
  try:
45
+ if image.mode != "RGB":
46
+ document = image.convert("RGB")
47
  except Exception as e:
48
  traceback.print_exc()
49
  error = str(e)