alex-kudrya/lara-thumb

A simple lite script that make thumbnails from original images

1.4.1 2020-05-27 00:00 UTC

This package is auto-updated.

Last update: 2024-04-29 04:40:05 UTC


README

Total Downloads Version License

This script converts the original image into a thumbnail with the given sizes and various modes

Modes: «cover», «contain».

Available extensions: «jpg / jpeg», «png», «gif».

Example

use Illuminate\Http\Request;
use Kudrya\LaraThumb\LaraThumb

class MakeThumbnail()
{
  public function run(Request $request, int $width = 100, int $height = 100)
  {
    $file = $request->file('image');
    LaraThumb::processing($file, $width, $height, 'cover', false)
    
    // That's all, your image was reduced!
    // Then save the $file or do what you need with it...
    
  }
};