2017 © Pedro Peláez
 

library laravel-image-handler

Package provides laravel with Image Handler class, perfect to create thumbs, resize or crop images.

image

amostajo/laravel-image-handler

Package provides laravel with Image Handler class, perfect to create thumbs, resize or crop images.

  • Thursday, July 2, 2015
  • by amostajo
  • Repository
  • 1 Watchers
  • 6 Stars
  • 493 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 1 Open issues
  • 3 Versions
  • 12 % Grown

The README.md

IMAGE HANDLER (for Laravel 5)

Latest Stable Version Total Downloads License, (*1)

Image handling solution for Laravel 5, creates thumbs on the fly, handles image cropping, upscaling and resizing., (*2)

Works with Laravel 5.1., (*3)

Installation

Add, (*4)

"amostajo/laravel-image-handler": "1.0.1"

to your composer.json. Then run composer install or composer update., (*5)

Then in your config/app.php add, (*6)

Amostajo\LaravelImageHandler\Providers\ImageHandlerProvider::class,

in the providers array., (*7)

Then add, (*8)

'ImageHandler'      => Amostajo\LaravelImageHandler\Facades\ImageHandler::class,

in the aliases array., (*9)

Copy and rename the config file [package]\config\config.php to your laravel's config directory [root]\config\image.php., (*10)

Usage

Creating a thumb for an image have never been this easy:, (*11)

// $imageUrl is exactly that, an image url.
// From either your own website or from an external source.
$url = ImageHandler::thumb($imageUrl);

ImageHandler will actually create a thumb and place it in public/thumbs directory., (*12)

The returned $url can be placed in a img html tag like this (sample using blade):, (*13)

<img src="{{ ImageHandler::thumb($imageUrl) }}"/>

Thumb, (*14)

The thumb created will always be cropped to fit the desired size. By default, the thumb will be cropped to the width and height specified in the configuration file, although you can easily set these as parameters:, (*15)

<img src="{{ ImageHandler::thumb($imageUrl, 800, 180) }}"/>

Thumb, (*16)

If you don't want the image to be cropped, prefer to keep constraints and just resize, use these methods instead:, (*17)

// Resized / scaled to a specific width
$url = ImageHandler::width($imageUrl);


// Resized / scaled to a specific height
$url = ImageHandler::height($imageUrl);
<img src="{{ ImageHandler::width($imageUrl, 350) }}"/>

Thumb, (*18)

<img src="{{ ImageHandler::height($imageUrl, 350) }}"/>

Thumb, (*19)

Configuration

Modify the configuration file to adjust the default thumb sizes, set the name of the folder path for the thumbs to be stored and more., (*20)

License

This package is free software distributed under the terms of the MIT license., (*21)

Additional Information

This package uses php-image-resize., (*22)

Image credits

Beach Taken from http://beachgrooves.com on 1st of July of 2015., (*23)

Sheep Taken from https://guim.co.uk on 1st of July of 2015., (*24)

The Versions

02/07 2015

dev-master

9999999-dev

Package provides laravel with Image Handler class, perfect to create thumbs, resize or crop images.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel image resize crop images thumbs thumb handler handling

02/07 2015

1.0.1

1.0.1.0

Package provides laravel with Image Handler class, perfect to create thumbs, resize or crop images.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel image resize crop images thumbs thumb handler handling

02/07 2015

v1.0.0

1.0.0.0

Package provides laravel with Image Handler class, perfect to create thumbs, resize or crop images.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel image resize crop images thumbs thumb handler handling