From 30a249ef0716f32016202a48edee46165cde74bc Mon Sep 17 00:00:00 2001 From: Lukas Steggers Date: Mon, 6 Oct 2025 10:19:03 +0200 Subject: [PATCH] fix: Removed .Jpg EndsWithAnyOf check - removed the bytecheck at the end of the file, because a valid jpg file does not match with the given file-end-byte-sequences from the validator - the affected file has the end-byte-sequence 0x27 0xe7 0x44 --- MagicBytesValidator/Formats/Jpg.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/MagicBytesValidator/Formats/Jpg.cs b/MagicBytesValidator/Formats/Jpg.cs index 65783ec..6a92613 100644 --- a/MagicBytesValidator/Formats/Jpg.cs +++ b/MagicBytesValidator/Formats/Jpg.cs @@ -13,13 +13,8 @@ public Jpg() : base( * - Image data must stop with trailer 0xFF 0xD9 * - JPEG may contain metadata after trailer. * - Currently available: Samsung specific metadata (ending on "SEFT") */ - - // TODO: We might remove the `EndsWithAnyOf` as metadata can be quite diverse. + StartsWith([0xFF, 0xD8, 0xFF]) - .Anywhere([0xFF, 0xD9]) - .EndsWithAnyOf([ - [0xFF, 0xD9], - [0x53, 0x45, 0x46, 0x54] - ]); + .Anywhere([0xFF, 0xD9]); } } \ No newline at end of file