Update main.py
Browse files
main.py
CHANGED
|
@@ -99,7 +99,7 @@ def analyze_with_gemini(image_path, user_text):
|
|
| 99 |
raise FileNotFoundError(f"圖片路徑無效:{image_path}")
|
| 100 |
|
| 101 |
# 打開本地圖片文件並將其轉換為 Base64 編碼
|
| 102 |
-
|
| 103 |
image_binary = image_file.read()
|
| 104 |
|
| 105 |
# 將二進制數據編碼為 Base64
|
|
|
|
| 99 |
raise FileNotFoundError(f"圖片路徑無效:{image_path}")
|
| 100 |
|
| 101 |
# 打開本地圖片文件並將其轉換為 Base64 編碼
|
| 102 |
+
with open(image_path, "rb") as image_file:
|
| 103 |
image_binary = image_file.read()
|
| 104 |
|
| 105 |
# 將二進制數據編碼為 Base64
|