Spaces:
Running
Running
BlueSkyXN
commited on
Commit
·
fc94a64
1
Parent(s):
8dbd049
0.1.1
Browse files- main.py +1 -1
- test_magick.py +2 -2
main.py
CHANGED
|
@@ -354,7 +354,7 @@ async def convert_image_dynamic(
|
|
| 354 |
logger.info(f"转换成功。输出文件: '{output_path}'")
|
| 355 |
|
| 356 |
original_filename_base = os.path.splitext(file.filename)[0]
|
| 357 |
-
download_filename = f"{original_filename_base}
|
| 358 |
|
| 359 |
# 动态设置 MimeType
|
| 360 |
media_type = f"image/{target_format}"
|
|
|
|
| 354 |
logger.info(f"转换成功。输出文件: '{output_path}'")
|
| 355 |
|
| 356 |
original_filename_base = os.path.splitext(file.filename)[0]
|
| 357 |
+
download_filename = f"{original_filename_base}.{target_format}"
|
| 358 |
|
| 359 |
# 动态设置 MimeType
|
| 360 |
media_type = f"image/{target_format}"
|
test_magick.py
CHANGED
|
@@ -9,8 +9,8 @@ api_base_url = "https://blueskyxn-imagemagickapi-hfs.hf.space"
|
|
| 9 |
|
| 10 |
# 转换参数: 格式/模式/设置
|
| 11 |
target_format = "avif" # avif, webp, jpeg, png, gif, heif
|
| 12 |
-
mode = "
|
| 13 |
-
setting =
|
| 14 |
|
| 15 |
# 构建完整的 API URL
|
| 16 |
api_url = f"{api_base_url}/convert/{target_format}/{mode}/{setting}"
|
|
|
|
| 9 |
|
| 10 |
# 转换参数: 格式/模式/设置
|
| 11 |
target_format = "avif" # avif, webp, jpeg, png, gif, heif
|
| 12 |
+
mode = "lossless" # lossy, lossless
|
| 13 |
+
setting = 0 # 0-100 (有损模式为质量, 无损模式为压缩速度)
|
| 14 |
|
| 15 |
# 构建完整的 API URL
|
| 16 |
api_url = f"{api_base_url}/convert/{target_format}/{mode}/{setting}"
|