Update app.py
Browse files
app.py
CHANGED
|
@@ -36,11 +36,11 @@ def create_collage(uploaded_files, grid_layout):
|
|
| 36 |
col = i % cols
|
| 37 |
collage.paste(img, (col * img.width, row * img.height))
|
| 38 |
|
| 39 |
-
# Save the collage as a PNG file in memory
|
| 40 |
output_io = io.BytesIO()
|
| 41 |
collage.save(output_io, format="PNG")
|
| 42 |
output_io.seek(0) # Reset the pointer to the start of the file
|
| 43 |
-
return output_io
|
| 44 |
|
| 45 |
# Gradio Interface
|
| 46 |
with gr.Blocks() as app:
|
|
|
|
| 36 |
col = i % cols
|
| 37 |
collage.paste(img, (col * img.width, row * img.height))
|
| 38 |
|
| 39 |
+
# Save the collage as a PNG file in memory (using BytesIO)
|
| 40 |
output_io = io.BytesIO()
|
| 41 |
collage.save(output_io, format="PNG")
|
| 42 |
output_io.seek(0) # Reset the pointer to the start of the file
|
| 43 |
+
return output_io # Return the BytesIO object for download
|
| 44 |
|
| 45 |
# Gradio Interface
|
| 46 |
with gr.Blocks() as app:
|