mylesai commited on
Commit
81b0e79
·
verified ·
1 Parent(s): 01e4942

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -216,6 +216,10 @@ def get_seo_tags(image_path, topical_map, new_imgs, attempts=0, max_attempts=6):
216
  # Open other image types with PIL directly
217
  image = Image.open(image_path)
218
 
 
 
 
 
219
  # Use in-memory buffer for processing
220
  with BytesIO() as img_buffer:
221
  if file_size > max_size:
 
216
  # Open other image types with PIL directly
217
  image = Image.open(image_path)
218
 
219
+ # Convert image to RGB if it has an alpha channel
220
+ if image.mode == 'RGBA':
221
+ image = image.convert('RGB')
222
+
223
  # Use in-memory buffer for processing
224
  with BytesIO() as img_buffer:
225
  if file_size > max_size: