Spaces:
Sleeping
Sleeping
Update Image_text_generation.py
Browse files- Image_text_generation.py +2 -2
Image_text_generation.py
CHANGED
|
@@ -47,10 +47,10 @@ class Image_text_Generator:
|
|
| 47 |
image = PIL.Image.open(io.BytesIO(image_binary))
|
| 48 |
|
| 49 |
# 建立暫存檔案以便上傳
|
| 50 |
-
image.save('
|
| 51 |
|
| 52 |
# 返回圖片的連結
|
| 53 |
-
return '
|
| 54 |
except Exception as e:
|
| 55 |
print(f"圖片上傳失敗: {e}")
|
| 56 |
return None
|
|
|
|
| 47 |
image = PIL.Image.open(io.BytesIO(image_binary))
|
| 48 |
|
| 49 |
# 建立暫存檔案以便上傳
|
| 50 |
+
image.save('static/'+self.user_id+'.png', format='PNG')
|
| 51 |
|
| 52 |
# 返回圖片的連結
|
| 53 |
+
return 'static/'+self.user_id+'.png'
|
| 54 |
except Exception as e:
|
| 55 |
print(f"圖片上傳失敗: {e}")
|
| 56 |
return None
|