From 8baac46d5081775ed2086af13c9754eb741826d8 Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Tue, 27 May 2025 15:53:31 +0200 Subject: [PATCH] Optimize GIF detection --- src/Drivers/AbstractDecoder.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Drivers/AbstractDecoder.php b/src/Drivers/AbstractDecoder.php index cdf94352..65797482 100644 --- a/src/Drivers/AbstractDecoder.php +++ b/src/Drivers/AbstractDecoder.php @@ -22,9 +22,7 @@ abstract class AbstractDecoder implements DecoderInterface */ protected function isGifFormat(string $input): bool { - $head = substr($input, 0, 6); - - return $head === 'GIF87a' || $head === 'GIF89a'; + return str_starts_with($input, 'GIF87a') || str_starts_with($input, 'GIF89a'); } /**