1
0
mirror of synced 2025-02-16 10:22:32 +01:00

fix: mai2 photos cant be merged

This commit is contained in:
SoulGateKey 2024-11-11 21:16:19 +08:00
parent 8a6250bebd
commit f4dff9b4c1

View File

@ -386,11 +386,11 @@ class Mai2Frontend(FE_Base):
self.logger.info(f"Photo Path Exist.")
max_idx = 0
p = ImageFile.Parser()
for _, _, files in walk("out_folder"):
for _, _, files in walk(f"{out_folder}"):
if not files:
break
matcher = re.match("^(\d+)_(\d+)$", files[0])
matcher = re.match(r"^(\d+)_(\d+)\.bin$", files[0])
if not matcher:
break
@ -405,7 +405,7 @@ class Mai2Frontend(FE_Base):
return Response(status_code=500)
for i in range(max_idx + 1):
with open(f"{out_folder}/{i}_{max_idx}", "rb") as f:
with open(f"{out_folder}/{i}_{max_idx}.bin", "rb") as f:
p.feed(f.read())
try:
im = p.close()