Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,8 +26,7 @@ def load_image_as_bytes(image_path):
|
|
| 26 |
img.save(img_bytes, format="JPEG") # Lưu ảnh vào buffer
|
| 27 |
return img_bytes.getvalue() # Lấy dữ liệu nhị phân
|
| 28 |
except FileNotFoundError:
|
| 29 |
-
print(f"❌ Lỗi: Không tìm thấy file
|
| 30 |
-
{image_path}")
|
| 31 |
return None
|
| 32 |
except UnidentifiedImageError:
|
| 33 |
print(f"❌ Lỗi: Không thể mở file {image_path} (định dạng không hợp lệ)")
|
|
|
|
| 26 |
img.save(img_bytes, format="JPEG") # Lưu ảnh vào buffer
|
| 27 |
return img_bytes.getvalue() # Lấy dữ liệu nhị phân
|
| 28 |
except FileNotFoundError:
|
| 29 |
+
print(f"❌ Lỗi: Không tìm thấy file {image_path}")
|
|
|
|
| 30 |
return None
|
| 31 |
except UnidentifiedImageError:
|
| 32 |
print(f"❌ Lỗi: Không thể mở file {image_path} (định dạng không hợp lệ)")
|