1. Go to this page and download the library: Download samayo/bulletproof library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// To provide a name for the image. If unused, image name will be auto-generated.
$image->setName($name);
// To set the min/max image size to upload (in bytes)
$image->setSize($min, $max);
// To define a list of allowed image types to upload
$image->setMime(array('jpeg', 'gif'));
// To set the max image height/width to upload (limit in pixels)
$image->setDimension($width, $height);
// To create a folder name to store the uploaded image, with optional chmod permission
$image->setStorage($folderName, $optionalPermission);
// To get the image name
$image->getName();
// To get the image size (in bytes)
$image->getSize();
// To get the image mime (extension)
$image->getMime();
// To get the image width in pixels
$image->getWidth();
// To get the image height in pixels
$image->getHeight();
// To get image location (folder where images are uploaded)
$image->getStorage();
// To get the full image path. ex 'images/logo.jpg'
$image->getPath();
// To get the json format value of all the above information
$image->getJson();