Update app.py
Browse files
app.py
CHANGED
|
@@ -182,9 +182,9 @@ async def create_album(
|
|
| 182 |
try:
|
| 183 |
# Create a blank image with the file content as text
|
| 184 |
img = Image.new('RGB', (200, 200), color=(73, 109, 137))
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
file.content_type = "image/png"
|
| 189 |
except Exception as e:
|
| 190 |
print(f"Error converting file to PNG: {str(e)}")
|
|
|
|
| 182 |
try:
|
| 183 |
# Create a blank image with the file content as text
|
| 184 |
img = Image.new('RGB', (200, 200), color=(73, 109, 137))
|
| 185 |
+
img_byte_arr = io.BytesIO()
|
| 186 |
+
img.save(img_byte_arr, format='PNG')
|
| 187 |
+
file_content = img_byte_arr.getvalue()
|
| 188 |
file.content_type = "image/png"
|
| 189 |
except Exception as e:
|
| 190 |
print(f"Error converting file to PNG: {str(e)}")
|