tintran / image_checker
Package for checking type of an image
dev-master
2018-06-13 16:20 UTC
Requires (Dev)
- phpunit/phpunit: ^7
This package is not auto-updated.
Last update: 2025-03-02 07:25:23 UTC
README
This package is used for detacting image formats. Currently supported formats: JPG, JPEG, PNG, BMP, GIF.
Installation
The package can be installed via composer:
$ composer require tintran/image_checker
Usage
Detacting an image format from local path or online links, resources.
Instantiate a new instance:
$img = new ImageChecker($src); // $src can be a local path or an online link
Get image format:
echo $img->getImageFormat(); // return 'JPG', 'PNG', 'GIF', 'BMP', ...
Supporting functions to check whether an image is a specified format
$img->isJPG(); $img->isPNG(); $img->isGIF(); $img->isBMP(); // return true or false