Haofei Yu
commited on
Commit
•
b36482e
1
Parent(s):
224a92f
Fix non image problem (#29)
Browse files* change theme
* change theme
* support no image
app.py
CHANGED
@@ -17,6 +17,8 @@ DEPLOYED = os.getenv("DEPLOYED", "true").lower() == "true"
|
|
17 |
|
18 |
|
19 |
def convert_base64(image_array):
|
|
|
|
|
20 |
image = Image.fromarray(image_array)
|
21 |
buffer = io.BytesIO()
|
22 |
image.save(buffer, format="PNG")
|
|
|
17 |
|
18 |
|
19 |
def convert_base64(image_array):
|
20 |
+
if image_array is None:
|
21 |
+
return None
|
22 |
image = Image.fromarray(image_array)
|
23 |
buffer = io.BytesIO()
|
24 |
image.save(buffer, format="PNG")
|