pagevamp / laravel-image-processor
Package for uploading / resizing images into disk. Tested with s3/local & laravel 5.8
0.0.1
2019-08-15 09:59 UTC
Requires
- intervention/image: ^2.5
- laravel/framework: 5.*
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.12
- orchestra/testbench: ^3.5
This package is auto-updated.
Last update: 2024-11-15 21:23:51 UTC
README
A simple package for laravel to upload and resize media without any hassle.
Installation
Before to start you'll need to clone/download this package locally and then run from the terminal
$ composer install
$ php artisan vendor:publish
Usage
env('MEDIA_STORAGE_DRIVER', 's3')
handles the disk s3
or public
$processor = new Processor('pv_photo.png');` // accepts path to image
or
$processor = new Processor($request->file('image'));` // accepts path to image
$processor->resize(['small' => [100,200],'large' => [2000,1000]); // and you can define size and ratio so on
$processor->uploadResizedImages();
or
$processor->getResizedImages()->each(function ($resizedImage){
$resizedImage->setName('generatecustomname.jpg');
$resizedImage->upload();
$resizedImage->getUploadedfileUrl();
});
Features
- Reads image from request / disk
- Upload original image with unique name with given sets of data
- Resize image into multiple sizes
- Upload resized images with custom name with custom path
- Currently tested with amazons3 and local storage