From cb4516f869cc50942066f47d4b58db44a21f0b18 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Mon, 2 Oct 2023 19:41:19 +0700 Subject: [PATCH] Added support for bmp images (#931) --- library/attach_mod/includes/functions_thumbs.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/library/attach_mod/includes/functions_thumbs.php b/library/attach_mod/includes/functions_thumbs.php index 6c44ba0cd..b96a4db5c 100644 --- a/library/attach_mod/includes/functions_thumbs.php +++ b/library/attach_mod/includes/functions_thumbs.php @@ -77,6 +77,8 @@ function get_supported_image_types($type) $new_type = ($format & IMG_PNG) ? IMG_PNG : 0; break; case IMAGETYPE_BMP: + $new_type = ($format & IMG_BMP) ? IMG_BMP : 0; + break; case IMAGETYPE_WBMP: $new_type = ($format & IMG_WBMP) ? IMG_WBMP : 0; break; @@ -140,6 +142,9 @@ function create_thumbnail($source, $new_file, $mimetype) case IMG_PNG: $image = imagecreatefrompng($source); break; + case IMG_BMP: + $image = imagecreatefrombmp($source); + break; case IMG_WBMP: $image = imagecreatefromwbmp($source); break; @@ -168,6 +173,9 @@ function create_thumbnail($source, $new_file, $mimetype) case IMG_PNG: imagepng($new_image, $new_file); break; + case IMG_BMP: + imagebmp($new_image, $new_file); + break; case IMG_WBMP: imagewbmp($new_image, $new_file); break;