PHP code example of gdaws / imageresizer

1. Go to this page and download the library: Download gdaws/imageresizer 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/ */

    

gdaws / imageresizer example snippets


use Gdaws\ImageResizer\ResizerFacade;
use Gdaws\ImageResizer\Exception\ImageResizerException;

$resizer = new ResizerFacade();

try {

    $resizer->resize('in.jpg', 'out.jpg', array(
        "mode" => "crop",
        "width" => 100,
        "height" => 100,
        "quality" => 80
    ));
}
catch(ImageResizerException $exception) {

    echo $exception->getMessage();
}