PHP code example of digitalzenworks / php-image-optimizer
1. Go to this page and download the library: Download digitalzenworks/php-image-optimizer 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/ */
digitalzenworks / php-image-optimizer example snippets
$image = new DigitalZenWorks\ImageOptimizer($input_filename);
$image->smartResize($output_width, $output_height, false);
$image->writeImage($output_filename);
$image = new DigitalZenWorks\ImageOptimizer($input_filename);
$image->smartResize($output_width, 0, false);
$image->writeImage($output_filename);