Fix handling LIST before anih

This commit is contained in:
Mike L 2025-04-30 00:38:59 +02:00
parent d57a50bedd
commit 4fa6174d1c
Signed by: mikeslab
GPG key ID: 48CCD1768D862D40
3 changed files with 12 additions and 3 deletions

View file

@ -17,10 +17,13 @@ def analyzeANIFile(filePath):
return {"code":-1,"msg":"File is not a ANI File!"}
logging.debug('魔数检查完成!')
frameRate = (1/60)*1000
readANIH = False
while(True):
chunkName = f.read(4)
if chunkName == b'LIST':
if chunkName == b'LIST' and readANIH:
break
if chunkName == b'anih':
readANIH = True
chunkSize = int.from_bytes(f.read(4), byteorder='little', signed=False)
if chunkName.lower() == b'rate':
logging.debug('发现自定义速率!')