rogerxavier commited on
Commit
9e986dc
1 Parent(s): f8096b7

Update api.py

Browse files
Files changed (1) hide show
  1. api.py +7 -5
api.py CHANGED
@@ -27,11 +27,13 @@ def t5():
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 "获取图片保存成功"
 
 
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
+