From 9bd41d44ebada5020db9cf398fb5721851fefee2 Mon Sep 17 00:00:00 2001 From: Sudhir Balaji Date: Wed, 25 Sep 2024 00:12:04 +0100 Subject: [PATCH] Match against all 8 PNG file signature bytes --- filetype/types/image.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/filetype/types/image.py b/filetype/types/image.py index 783aa7b..875b1cb 100644 --- a/filetype/types/image.py +++ b/filetype/types/image.py @@ -137,8 +137,11 @@ def match(self, buf): buf[0] == 0x89 and buf[1] == 0x50 and buf[2] == 0x4E and - buf[3] == 0x47) - + buf[3] == 0x47 and + buf[4] == 0x0D and + buf[5] == 0x0A and + buf[6] == 0x1A and + buf[7] == 0x0A) class Gif(Type): """