PHP code example of ihorhnatchuk / laravel-image-thumbnail

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

    

ihorhnatchuk / laravel-image-thumbnail example snippets


Thumbnail::url('/uploads/photo.jpg',300,300,array('crop','grayscale'));

Thumbnail::make('/uploads/photo.jpg',array(
	'width' => 300,
	'height' => 300,
	'grayscale' => true
))->save('/path/to/the/thumbnail.jpg');

$thumbnail = Thumbnail::open('/uploads/photo.jpg')
			->thumbnail(new Imagine\Image\Box(300,300));

$thumbnail->effects()->grayscale();
	
$thumbnail->save('/path/to/the/thumbnail.jpg');

'Folklore\Image\ImageServiceProvider',

'Image' => 'Folklore\Image\Facades\Image',
html
<img src="<?=Thumbnail::url('/uploads/photo.jpg',300,300,array('crop','grayscale'))
bash
$ php artisan vendor:publish --provider="Folklore\Image\ImageServiceProvider"

app/config/image.php