fix: address phase 1 ai review

This commit is contained in:
QiuSW
2026-07-02 14:47:22 +08:00
parent 2d9c233683
commit 2f93374193
18 changed files with 499 additions and 56 deletions
+3 -2
View File
@@ -110,14 +110,15 @@ def decode_image_data_url(data_url: str) -> bytes:
def resolution_to_size(resolution: str) -> str:
key = str(resolution).strip().upper()
mapping = {
"512": "512x512",
"512px": "512x512",
"512PX": "512x512",
"1K": "1024x1024",
"2K": "2048x2048",
"4K": "4096x4096",
}
return mapping.get(str(resolution), str(resolution))
return mapping.get(key, str(resolution).strip())
def extract_image_from_response(