From ed9624a02205e0f615c7b9d69cd30c9b71cd8ad9 Mon Sep 17 00:00:00 2001 From: CatKasha Date: Fri, 22 Apr 2022 21:32:13 +0300 Subject: [PATCH] cosmetic changes (apng) --- filetype/types/image.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/filetype/types/image.py b/filetype/types/image.py index 0dd38c9..1eb4928 100644 --- a/filetype/types/image.py +++ b/filetype/types/image.py @@ -63,8 +63,8 @@ def __init__(self): def match(self, buf): if (len(buf) > 8 and - buf[:8] == bytearray([0x89, 0x50, 0x4e, 0x47, - 0x0d, 0x0a, 0x1a, 0x0a])): + buf[:8] == bytearray([0x89, 0x50, 0x4e, 0x47, + 0x0d, 0x0a, 0x1a, 0x0a])): #cursor in buf, skip already readed 8 bytes i = 8 while len(buf) > i: @@ -74,11 +74,11 @@ def match(self, buf): chunk_type = buf[i:i+4].decode("ascii") i += 4 - #acTL chunk in APNG should appears first than IDAT + #acTL chunk in APNG must appear before IDAT #IEND is end of PNG if (chunk_type == "IDAT" or chunk_type == "IEND"): return False - elif (chunk_type == "acTL"): + if (chunk_type == "acTL"): return True #move to the next chunk by skipping data and crc (4 bytes)