diff --git a/src/Helpers/Util.php b/src/Helpers/Util.php index c03866d..1cb2883 100644 --- a/src/Helpers/Util.php +++ b/src/Helpers/Util.php @@ -68,8 +68,8 @@ public function logger(string $path, object $data, bool $serialize = false): voi */ public function fileToBase64(string $filePath): string { - $finfo = new \finfo(FILEINFO_MIME_TYPE); - return 'data:' . $finfo->file($filePath) . ';base64,' . base64_encode(file_get_contents($filePath)); + $type = image_type_to_mime_type(exif_imagetype($filePath)); + return 'data:' . $type . ';base64,' . base64_encode(file_get_contents($filePath)); } /**