2017 © Pedro Peláez
 

library laravel-pub-preview

Get resized image from public directory

image

masteryuri/laravel-pub-preview

Get resized image from public directory

  • Sunday, April 10, 2016
  • by MasterYuri
  • Repository
  • 1 Watchers
  • 1 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Laravel-PubPreview Beta

Component get resized images from public (storage) directory., (*1)

You upload image and use it for preview:, (*2)

``` html Preview Preview, (*3)


But usually image is too big so you have to generate smaller files: ``` html <img src="{{ asset('img/photo1_100x100.jpg') }}" alt="Preview"> <img src="{{ asset($article->preview_100x100) }}" alt="Preview">

This library lets you to simplify it and make it on fly:, (*4)

``` html Preview Preview, (*5)


Also you can configure image that must be shown if requested image doesn't exists. @todo watermark ## How it works Algotitm: * `pub_review()` generates url to library controller action. * Controller checks if it has resized image. If no - it generates resized image and saves it to temporaty directory. * Controller returns resized image from temporary directory. ## Parameters of pub_review() * Relative path to image file. * Require width in pixels. * Require height in pixels. * Required resize mode. Available modes are 'scale', 'fitin', 'fitout': ![alt tag](http://zmicron.org/tpl/components/get_img/mode.png) ## Installation Via Composer ``` bash $ composer require masteryuri/laravel-pubpreview

Add service provider into /config/app.php:, (*6)

'MasterYuri\PubPreview\ServiceProvider',

Publish config and resources:, (*7)

php artisan vendor:publish --provider="MasterYuri\PubPreview\ServiceProvider"

Configuration

Configuration file is 'pub-preview.php'. It has comments that describe all parameters., (*8)

Read configuration file, (*9)

License

The MIT License (MIT). Please see License File for more information., (*10)

The Versions

10/04 2016

dev-master

9999999-dev https://github.com/MasterYuri/Laravel-PubPreview

Get resized image from public directory

  Sources   Download

MIT

The Requires

 

The Development Requires

resize image masteryuri laravel-pub-preview scale image image fitin fitout resize on fly scale on fly generate preview on fly