Skip to content

Commit

Permalink
Match all 8 bytes of PNG signature
Browse files Browse the repository at this point in the history
  • Loading branch information
sudhir-b committed Sep 24, 2024
1 parent 0c7f219 commit 6553f0f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions filetype/types/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,15 @@ def __init__(self):
)

def match(self, buf):
return (len(buf) > 3 and
return (len(buf) > 8 and
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):
"""
Expand Down

0 comments on commit 6553f0f

Please sign in to comment.