Spaces:
Sleeping
Sleeping
rogerxavier
commited on
Commit
•
9e986dc
1
Parent(s):
f8096b7
Update api.py
Browse files
api.py
CHANGED
@@ -27,11 +27,13 @@ def t5():
|
|
27 |
|
28 |
|
29 |
|
|
|
30 |
@app.post("/getOriginalMangaList")
|
31 |
-
async def getOriginalMangaList(
|
32 |
-
for
|
33 |
-
img =
|
34 |
-
image = Image.open(img).convert("L").convert("RGB")
|
35 |
path_to_image = f"/manga/{idx}.jpg"
|
36 |
image.save(path_to_image)
|
37 |
-
return "获取图片保存成功"
|
|
|
|
27 |
|
28 |
|
29 |
|
30 |
+
|
31 |
@app.post("/getOriginalMangaList")
|
32 |
+
async def getOriginalMangaList(images: List[UploadFile] = File(...)):
|
33 |
+
for image in images:
|
34 |
+
img = await image.read()
|
35 |
+
image = Image.open(io.BytesIO(img)).convert("L").convert("RGB")
|
36 |
path_to_image = f"/manga/{idx}.jpg"
|
37 |
image.save(path_to_image)
|
38 |
+
return "获取图片保存成功"
|
39 |
+
|