Skip to content

Commit 5b95078

Browse files
author
isatsam
committed
Add DDS
1 parent 590dac5 commit 5b95078

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

filetype/types/image.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,3 +402,24 @@ def match(self, buf):
402402
buf[1] == 0x6F and
403403
buf[2] == 0x69 and
404404
buf[3] == 0x66)
405+
406+
407+
class Dds(Type):
408+
"""
409+
Implements the DirectDraw Surface (DDS) image type matcher.
410+
"""
411+
MIME = 'image/dds'
412+
EXTENSION = 'dds'
413+
414+
def __init__(self):
415+
super(Dds, self).__init__(
416+
mime=Dds.MIME,
417+
extension=Dds.EXTENSION
418+
)
419+
420+
def match(self, buf):
421+
return (len(buf) > 4 and
422+
buf[0] == 0x44 and
423+
buf[1] == 0x44 and
424+
buf[2] == 0x53 and
425+
buf[3] == 0x20)

0 commit comments

Comments
 (0)