alex-kudrya/lara-thumb

A simple lite script that make thumbnails from original images

Installs: 28

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/alex-kudrya/lara-thumb

1.4.1 2020-05-27 00:00 UTC

This package is auto-updated.

Last update: 2025-09-29 02:22:04 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...
    
  }
};