PHP code example of assetplan / imgproxy

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

    

assetplan / imgproxy example snippets




$key = '0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef';
$salt = '0123456789abcdef0123456789abcdef';

$builder = new Assetplan\Imgproxy\UrlBuilder('https://imgproxy.example.com', $key, $salt);

$url = $builder->setImageUrl('https://example.com/image.jpg')->insecure()->resize(100, 100, ResizingType::Fill)->getUrl();

// https://imgproxy.example.com/insecure/rs:fill:100:100/plain/https://example.com/image.jpg