PocketMine-MP virion that resize image size
The image converter tool has the ability to resize images.
Supported image formats are png, jpg, and gif.
Called the class to resize the image
use skh6075\lib\imageresize\ImageResize;Get the image path and called the converter.
$converter = ImageResize::converter(string $imagePath);After writing down the size to be adjusted and the path to save the adjusted image,
call the resizing method.
$converter->resizing(string $destPath, int $width, int $height);This is a method to check the image adjustment result for developers.
use skh6075\lib\imageresize\convert\utils\ImageResizeResult;
switch($converter){
case ImageResizeResult::SUCCESS():
echo "Image resizing success";
break;
case ImageResizeResult::FAILURE():
echo "Image resizing failure";
break;
case ImageResizeResult::NONE():
echo "Prepare for image resizing";
break;
}