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

This package is auto-updated.

Last update: 2024-04-15 20:13:27 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

68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f34613365353534356437643162656439353530362f6d61696e7461696e6162696c697479

wercker status