rogerxavier commited on
Commit
63aa27b
1 Parent(s): 6007ea2

Update api.py

Browse files
Files changed (1) hide show
  1. api.py +2 -2
api.py CHANGED
@@ -31,10 +31,10 @@ def t5():
31
 
32
  @app.post("/getOriginalMangaList")
33
  async def getOriginalMangaList(images: List[UploadFile] = File(...)):
34
- for image in images:
35
  img = await image.read()
36
  image = Image.open(io.BytesIO(img)).convert("L").convert("RGB")
37
- path_to_image = f"/manga/{images.index(image)}.jpg"
38
  image.save(path_to_image)
39
  return "获取图片保存成功"
40
 
 
31
 
32
  @app.post("/getOriginalMangaList")
33
  async def getOriginalMangaList(images: List[UploadFile] = File(...)):
34
+ for idx, image in enumerate(images):
35
  img = await image.read()
36
  image = Image.open(io.BytesIO(img)).convert("L").convert("RGB")
37
+ path_to_image = f"/manga/{idx}.jpg"
38
  image.save(path_to_image)
39
  return "获取图片保存成功"
40