PHP code example of maximal / php-avif-thumbnailer

1. Go to this page and download the library: Download maximal/php-avif-thumbnailer 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/ */

    

maximal / php-avif-thumbnailer example snippets


use Maximal\Thumbnailers\AvifThumbnailer;

echo AvifThumbnailer::picture('/path/to/img/image.png', $width, $height);

use Maximal\Thumbnailers\AvifThumbnailer;

echo AvifThumbnailer::picture(
	'/path/to/img/image.png',
	$width,
	$height,
	false,
	['alt' => 'Alt attribute', 'class' => 'img-responsive']
);

use Maximal\Thumbnailers\AvifThumbnailer;

AvifThumbnailer::$ffmpegCommand = '/usr/local/bin/ffmpeg';
echo AvifThumbnailer::picture('/path/to/img/image.jpg', $width, $height);
bash
composer 

"maximal/php-avif-thumbnailer": "^1.0"