This commit is contained in:
Amberstone 2024-10-05 05:55:29 +09:00
parent 7b9597da2d
commit e78d92c535
Signed by: amber
GPG key ID: 094B0E55F98D8BF1

View file

@ -2,19 +2,19 @@
require_once("config.php"); require_once("config.php");
if (!function_exists('ft_nonce_is_valid')) { if (!function_exists('ft_nonce_is_valid')) {
include_once "../editor.lib.php"; include_once('../editor.lib.php');
} }
if (!function_exists('che_reprocessImage')) { if (!function_exists('che_reprocessImage')) {
function che_reprocessImage($file_path, $callback) function che_reprocessImage($file_path, $callback)
{ {
$MIME_TYPES_PROCESSORS = array( $MIME_TYPES_PROCESSORS = array(
"image/gif" => array("imagecreatefromgif", "imagegif"), "image/gif" => ["imagecreatefromgif", "imagegif"],
"image/jpg" => array("imagecreatefromjpeg", "imagejpeg"), "image/jpg" => ["imagecreatefromjpeg", "imagejpeg"],
"image/jpeg" => array("imagecreatefromjpeg", "imagejpeg"), "image/jpeg" =>["imagecreatefromjpeg", "imagejpeg"],
"image/png" => array("imagecreatefrompng", "imagepng"), "image/png" => ["imagecreatefrompng", "imagepng"],
"image/webp" => array("imagecreatefromwebp", "imagewebp"), "image/webp" =>["imagecreatefromwebp", "imagewebp"],
"image/bmp" => array("imagecreatefromwbmp", "imagewbmp") "image/bmp" => ["imagecreatefromwbmp", "imagewbmp"],
); );
// Extracting mime type using getimagesize // Extracting mime type using getimagesize