rogerxavier
commited on
Commit
•
f8096b7
1
Parent(s):
7ab60ac
Update api.py
Browse files
api.py
CHANGED
@@ -27,16 +27,11 @@ def t5():
|
|
27 |
|
28 |
|
29 |
|
30 |
-
@app.post("/
|
31 |
-
async def
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
|
|
27 |
|
28 |
|
29 |
|
30 |
+
@app.post("/getOriginalMangaList")
|
31 |
+
async def getOriginalMangaList(image_list: dict):
|
32 |
+
for idx, img_data in enumerate(image_list["imageList"]):
|
33 |
+
img = io.BytesIO(img_data.encode())
|
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 "获取图片保存成功"
|
|
|
|
|
|
|
|
|
|