Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -67,11 +67,12 @@ app_ui = ui.page_fillable(
|
|
| 67 |
|
| 68 |
### HELPER FUNCTIONS ###
|
| 69 |
def tif_bytes_to_pil_image(tif_bytes):
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
|
|
|
| 75 |
|
| 76 |
return image
|
| 77 |
|
|
|
|
| 67 |
|
| 68 |
### HELPER FUNCTIONS ###
|
| 69 |
def tif_bytes_to_pil_image(tif_bytes):
|
| 70 |
+
# Create a BytesIO object from the TIFF bytes
|
| 71 |
+
bytes_io = io.BytesIO(tif_bytes)
|
| 72 |
+
|
| 73 |
+
# Open the BytesIO object as an Image, resize to 256
|
| 74 |
+
image = Image.open(bytes_io).convert("RGB")
|
| 75 |
+
image = image.resize((256, 256))
|
| 76 |
|
| 77 |
return image
|
| 78 |
|