mirror of
https://mikeslab.dix.asia/gogs/My-Mods/ANI2Cape.git
synced 2025-10-01 23:14:57 +00:00
Fix handling LIST before anih
This commit is contained in:
parent
d57a50bedd
commit
4fa6174d1c
3 changed files with 12 additions and 3 deletions
|
@ -43,10 +43,13 @@ def analyzeANI(f):
|
||||||
return {'code': -1, 'msg': 'File is not a ANI File!'}
|
return {'code': -1, 'msg': 'File is not a ANI File!'}
|
||||||
logging.debug('魔数检查完成!')
|
logging.debug('魔数检查完成!')
|
||||||
frameRate = (1/60)*1000
|
frameRate = (1/60)*1000
|
||||||
|
readANIH = False
|
||||||
while (True):
|
while (True):
|
||||||
chunkName = f.read(4)
|
chunkName = f.read(4)
|
||||||
if chunkName == b'LIST':
|
if chunkName == b'LIST' and readANIH:
|
||||||
break
|
break
|
||||||
|
if chunkName == b'anih':
|
||||||
|
readANIH = True
|
||||||
chunkSize = int.from_bytes(f.read(4), byteorder='little', signed=False)
|
chunkSize = int.from_bytes(f.read(4), byteorder='little', signed=False)
|
||||||
if chunkName.lower() == b'rate':
|
if chunkName.lower() == b'rate':
|
||||||
logging.debug('发现自定义速率!')
|
logging.debug('发现自定义速率!')
|
||||||
|
|
|
@ -17,10 +17,13 @@ def analyzeANIFile(filePath):
|
||||||
return {"code":-1,"msg":"File is not a ANI File!"}
|
return {"code":-1,"msg":"File is not a ANI File!"}
|
||||||
logging.debug('魔数检查完成!')
|
logging.debug('魔数检查完成!')
|
||||||
frameRate = (1/60)*1000
|
frameRate = (1/60)*1000
|
||||||
|
readANIH = False
|
||||||
while(True):
|
while(True):
|
||||||
chunkName = f.read(4)
|
chunkName = f.read(4)
|
||||||
if chunkName == b'LIST':
|
if chunkName == b'LIST' and readANIH:
|
||||||
break
|
break
|
||||||
|
if chunkName == b'anih':
|
||||||
|
readANIH = True
|
||||||
chunkSize = int.from_bytes(f.read(4), byteorder='little', signed=False)
|
chunkSize = int.from_bytes(f.read(4), byteorder='little', signed=False)
|
||||||
if chunkName.lower() == b'rate':
|
if chunkName.lower() == b'rate':
|
||||||
logging.debug('发现自定义速率!')
|
logging.debug('发现自定义速率!')
|
||||||
|
|
|
@ -17,10 +17,13 @@ def analyzeANIFile(filePath):
|
||||||
return {"code":-1,"msg":"File is not a ANI File!"}
|
return {"code":-1,"msg":"File is not a ANI File!"}
|
||||||
logging.debug('魔数检查完成!')
|
logging.debug('魔数检查完成!')
|
||||||
frameRate = (1/60)*1000
|
frameRate = (1/60)*1000
|
||||||
|
readANIH = False
|
||||||
while(True):
|
while(True):
|
||||||
chunkName = f.read(4)
|
chunkName = f.read(4)
|
||||||
if chunkName == b'LIST':
|
if chunkName == b'LIST' and readANIH:
|
||||||
break
|
break
|
||||||
|
if chunkName == b'anih':
|
||||||
|
readANIH = True
|
||||||
chunkSize = int.from_bytes(f.read(4), byteorder='little', signed=False)
|
chunkSize = int.from_bytes(f.read(4), byteorder='little', signed=False)
|
||||||
if chunkName.lower() == b'rate':
|
if chunkName.lower() == b'rate':
|
||||||
logging.debug('发现自定义速率!')
|
logging.debug('发现自定义速率!')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue