Skip to content

Commit

Permalink
Merge pull request #665 from max-peroch/add-pdf-support-to-detectFile…
Browse files Browse the repository at this point in the history
…Type

Add PDF support to detectFileType
  • Loading branch information
drewnoakes committed Apr 2, 2024
2 parents e711005 + d963e6e commit 9f4ad4c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Source/com/drew/imaging/FileTypeDetector.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public class FileTypeDetector
_root.addPath(FileType.Flv, new byte[]{0x46, 0x4C, 0x56});
_root.addPath(FileType.Indd, new byte[]{0x06, 0x06, (byte)0xED, (byte)0xF5, (byte)0xD8, 0x1D, 0x46, (byte)0xE5, (byte)0xBD, 0x31, (byte)0xEF, (byte)0xE7, (byte)0xFE, 0x74, (byte)0xB7, 0x1D});
_root.addPath(FileType.Mxf, new byte[]{0x06, 0x0e, 0x2b, 0x34, 0x02, 0x05, 0x01, 0x01, 0x0d, 0x01, 0x02, 0x01, 0x01, 0x02}); // has offset?
_root.addPath(FileType.Pdf, new byte[]{0x25, 0x50, 0x44, 0x46});
_root.addPath(FileType.Qxp, new byte[]{0x00, 0x00, 0x49, 0x49, 0x58, 0x50, 0x52, 0x33}); // "..IIXPR3" (little-endian - intel)
_root.addPath(FileType.Qxp, new byte[]{0x00, 0x00, 0x4D, 0x4D, 0x58, 0x50, 0x52, 0x33}); // "..MMXPR3" (big-endian - motorola)
_root.addPath(FileType.Ram, new byte[]{0x72, 0x74, 0x73, 0x70, 0x3A, 0x2F, 0x2F});
Expand Down

0 comments on commit 9f4ad4c

Please sign in to comment.