PHP code example of silencesoft / slim-image-resize

1. Go to this page and download the library: Download silencesoft/slim-image-resize 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/ */

    

silencesoft / slim-image-resize example snippets


$app = new \Slim\Slim();
$app->add(new Slim\Middleware\ImageResize());

$app = new \Slim\Slim();
$app->add(new Slim\Middleware\ImageResize([
    "extensions" => ["jpg", "jpeg", "png", "gif"],
    "cache" => "cache",
    "quality" => 90
]));

$app = new \Slim\Slim();
$app->add(new Slim\Middleware\ImageResize([
    "sizes" => ["400x200", "x200", "200x", "100x100"]
]));

$app->add(new Slim\Middleware\ImageResize([
    "secret" => "s11kr3t"
]));

$sha1 = sha1("400x200:s11kr3t");
$signature = substr($sha1, 0, 16);