forked from Hay1tsme/artemis
fix: mai2 photos cant be merged
This commit is contained in:
@ -386,11 +386,11 @@ class Mai2Frontend(FE_Base):
|
|||||||
self.logger.info(f"Photo Path Exist.")
|
self.logger.info(f"Photo Path Exist.")
|
||||||
max_idx = 0
|
max_idx = 0
|
||||||
p = ImageFile.Parser()
|
p = ImageFile.Parser()
|
||||||
for _, _, files in walk("out_folder"):
|
for _, _, files in walk(f"{out_folder}"):
|
||||||
if not files:
|
if not files:
|
||||||
break
|
break
|
||||||
|
|
||||||
matcher = re.match("^(\d+)_(\d+)$", files[0])
|
matcher = re.match(r"^(\d+)_(\d+)\.bin$", files[0])
|
||||||
if not matcher:
|
if not matcher:
|
||||||
break
|
break
|
||||||
|
|
||||||
@ -405,7 +405,7 @@ class Mai2Frontend(FE_Base):
|
|||||||
return Response(status_code=500)
|
return Response(status_code=500)
|
||||||
|
|
||||||
for i in range(max_idx + 1):
|
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())
|
p.feed(f.read())
|
||||||
try:
|
try:
|
||||||
im = p.close()
|
im = p.close()
|
||||||
|
Reference in New Issue
Block a user