This commit is contained in:
2025-08-14 16:04:59 +08:00
commit d8bceb3fe1
73 changed files with 3644 additions and 0 deletions

Binary file not shown.

11
utils/image_utils.py Normal file
View File

@@ -0,0 +1,11 @@
from PIL import Image
import io
import base64
# 创建utils目录并迁移工具函数
def encode_image(image_path):
img = Image.open(image_path)
buffer = io.BytesIO()
img.save(buffer, format="JPEG")
buffer.seek(0)
return base64.b64encode(buffer.read()).decode('utf-8')