Return cropped images if fail

#4
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -520,6 +520,7 @@ def get_cropped_images(images, category):
520
  cropped_list.append(image)
521
  except Exception as e:
522
  print(f"Error processing image {num}: {e}")
 
523
 
524
  # Convert cropped images to base64 strings
525
  base64_images = encode_images_to_base64(cropped_list)
 
520
  cropped_list.append(image)
521
  except Exception as e:
522
  print(f"Error processing image {num}: {e}")
523
+ return []
524
 
525
  # Convert cropped images to base64 strings
526
  base64_images = encode_images_to_base64(cropped_list)