PHP code example of bonniss26 / wn-imagery-plugin

1. Go to this page and download the library: Download bonniss26/wn-imagery-plugin 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/ */

    

bonniss26 / wn-imagery-plugin example snippets


Imagery::style($post->featured_image);  // "background-image:...;background-size:cover" or ""
Imagery::css('photos/a.jpg');           // "linear-gradient(#b5b2a5,#b5b2a5)" or ""
Imagery::dimensions('photos/a.jpg');    // ['width' => 800, 'height' => 533] or null
Imagery::result($file);                 // Bonniss26\Lqip\LqipResult or null

$hash = Imagery::result($image)?->value(); // null until it has been generated
bash
php artisan imagery:warm             # Media Library images
php artisan imagery:warm --files     # ...and file attachments
php artisan imagery:warm --limit=200 # stop after 200 new placeholders
php artisan imagery:warm --force     # redo everything, even what is cached
bash
composer update bonniss26/wn-imagery-plugin   # also brings bonniss26/lqip 0.3
php artisan winter:up
php artisan imagery:warm