Skip to content

Commit cae34bd

Browse files
authored
Add support for .gif files (#31)
1 parent a2c4052 commit cae34bd

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

src/ByteGuard.FileValidator/FileExtensions.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,5 +129,10 @@ public static class FileExtensions
129129
/// High Efficiency Image Container.
130130
/// </summary>
131131
public const string Heic = ".heic";
132+
133+
/// <summary>
134+
/// Graphics Interchange Format.
135+
/// </summary>
136+
public const string Gif = ".gif";
132137
}
133138
}

src/ByteGuard.FileValidator/FileValidator.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,14 @@ public class FileValidator
257257
new byte[] { 0x66, 0x74, 0x79, 0x70, 0x68, 0x65, 0x69, 0x63 } // ftypheic
258258
},
259259
SignatureOffset = 4
260+
},
261+
new FileDefinition
262+
{
263+
FileType = FileExtensions.Gif,
264+
ValidSignatures = new List<byte[]>
265+
{
266+
new byte[] { 0x47, 0x49, 0x46, 0x38 }, // GIF8
267+
}
260268
}
261269
};
262270

0 commit comments

Comments
 (0)