Easy Image Optimiser

Class Features

Usage

Single Image


require_once "EasyOptimise.php";
$apiKey = ''; /* @TODO Add your API Key. */
$img = new EasyOptimise("$apiKey");
/*
single() takes 2 params
The filepath of the image,
Lossy or Lossless compression.
lossy = true, lossless = false.
Second Param is optional, this will be true by default.
*/
$img->single($filepath, true);
            

Multi


require_once "EasyOptimise.php";
$apiKey = ''; /* @TODO Add your API Key. */
$img = new EasyOptimise("$apiKey");
/*
multi() takes 2 params
The filepaths of the images,
Lossy or Lossless compression.
lossy = true, lossless = false.
Second Param is optional, this will be true by default.
*/
$files = array(
    'file1' => $path1,
    'file2' => $path2,
);
$img->multi($files, true);