2017 © Pedro Peláez
 

library imagine

Compressing images on the fly

image

androzd/imagine

Compressing images on the fly

  • Wednesday, March 30, 2016
  • by androzd
  • Repository
  • 1 Watchers
  • 0 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Laravel Imagine

This library provides easy way to generate image previews on the fly, (*1)

Installation

First, require the package using Composer:, (*2)

composer require androzd/imagine

Now, add these service providers to your config/app.php file (don't add the Intervention\Image\ImageServiceProvider::class if you already have it)., (*3)

Intervention\Image\ImageServiceProvider::class,
Androzd\Imagine\ImagineServiceProvider::class,

And finally add these to the aliases array (note: Image must be listed before Imagine):, (*4)

'Image'   => Intervention\Image\Facades\Image::class,
'Imagine' => Androzd\Imagine\ImagineFacade::class,

Feel free to use a different alias for Imagine if you'd prefer something shorter, (*5)

Configuration

There are a number of configuration options available for Imagine. Run the following Artisan command to publish the configuration option to your config directory:, (*6)

php artisan vendor:publish --provider="Androzd\Imagine\ImagineServiceProvider"

Usage


// compress image by rules Imagine::path('rule_name', 'path to image in public directory');

Example:, (*7)

Imagine::path('profile_image', '/uploads/original/avatar/1.jpg');

This example makes path: /cache/profile_image/uploads/original/avatar/1.jpg, (*8)

If this image exists, it was returned by your web server as static resource., (*9)

If not exists, they will be generated and saved to /cache/profile_image/uploads/original/avatar/1.jpg and next time will be returned as static image., (*10)

The Versions

30/03 2016

dev-master

9999999-dev

Compressing images on the fly

  Sources   Download

The Requires

 

by Andrey Drozd

30/03 2016

v0.1

0.1.0.0

Compressing images on the fly

  Sources   Download

The Requires

 

by Andrey Drozd