PHP code example of orchestra / imagine

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

    

orchestra / imagine example snippets


'providers' => [

    // ...

    Orchestra\Imagine\ImagineServiceProvider::class,
],

'aliases' => [

    // ...

    'Imagine' => Orchestra\Imagine\Facade::class,
],



use Imagine\Image\ImageInterface;
use Orchestra\Imagine\Jobs\CreateThumbnail;

dispatch(new CreateThumbnail([
    'path' => $path,
    'filename' => $filename, // filename without extension
    'extension' => $extension,
    'format' => '{filename}.thumb.{extension}',
    'dimension' => 320, // width and height will be 320.
    'mode' => ImageInterface::THUMBNAIL_OUTBOUND,
    'filter' => ImageInterface::FILTER_UNDEFINED,
]));