PHP code example of laravel-enso / imagetransformer

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

    

laravel-enso / imagetransformer example snippets


use LaravelEnso\ImageTransformer\Services\ImageTransformer;

$transformer = new ImageTransformer($file);

$transformer->optimize();

$transformer->width(512);

$transformer->height(512);

$transformer->resize(1024, 768);

$contents = $transformer
    ->upscaleTo(500, 500)
    ->toJpeg(quality: 85);