Update app.py
Browse files
app.py
CHANGED
|
@@ -27,7 +27,7 @@ def create_collage(uploaded_files, grid_layout):
|
|
| 27 |
# Resize or crop image to fit the grid cell size
|
| 28 |
img_width = collage_width // cols
|
| 29 |
img_height = collage_height // rows
|
| 30 |
-
img_resized = img.resize((img_width, img_height), Image.
|
| 31 |
resized_images.append(img_resized)
|
| 32 |
|
| 33 |
# Place images on the canvas in grid format without spacing
|
|
@@ -62,4 +62,4 @@ with gr.Blocks() as app:
|
|
| 62 |
download_button = gr.Button("Download Collage")
|
| 63 |
download_button.click(create_collage, inputs=[uploaded_files, grid_layout], outputs=output)
|
| 64 |
|
| 65 |
-
app.launch()
|
|
|
|
| 27 |
# Resize or crop image to fit the grid cell size
|
| 28 |
img_width = collage_width // cols
|
| 29 |
img_height = collage_height // rows
|
| 30 |
+
img_resized = img.resize((img_width, img_height), Image.Resampling.LANCZOS) # Resize to fit
|
| 31 |
resized_images.append(img_resized)
|
| 32 |
|
| 33 |
# Place images on the canvas in grid format without spacing
|
|
|
|
| 62 |
download_button = gr.Button("Download Collage")
|
| 63 |
download_button.click(create_collage, inputs=[uploaded_files, grid_layout], outputs=output)
|
| 64 |
|
| 65 |
+
app.launch(share=True) # Public link to share the app
|