Added support for bmp images (#931)

This commit is contained in:
Roman Kelesidis 2023-10-02 19:41:19 +07:00 committed by GitHub
commit cb4516f869
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;