From e90fff64845d67d0caca50eca3473b1af2133141 Mon Sep 17 00:00:00 2001 From: likman Date: Tue, 5 Apr 2022 15:27:01 +0300 Subject: [PATCH] Update TextToImage.php Case insensitive file extension --- src/TextToImage.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TextToImage.php b/src/TextToImage.php index 0df948f..97f881a 100644 --- a/src/TextToImage.php +++ b/src/TextToImage.php @@ -167,7 +167,7 @@ public function render(string $save_as = null, string $ext = null): string */ private function getExtension(string $filename): string { - return (($position = strrpos($filename,'.')) !== false) ? substr($filename,$position + 1) : ''; + return (($position = strrpos($filename,'.')) !== false) ? mb_strtolower(substr($filename,$position + 1)) : ''; } /** @@ -215,4 +215,4 @@ private function write($image, Text $text, int $x, int $y, array $color) imagestring($image, $font_size, $x, $y, $label, imagecolorallocatealpha($image, ...$color)); } } -} \ No newline at end of file +}