2017 © Pedro Peláez
 

library cropp

Image manipulations on-the-fly for Laravel 5

image

yaro/cropp

Image manipulations on-the-fly for Laravel 5

  • Sunday, January 31, 2016
  • by Cherry Pie
  • Repository
  • 1 Watchers
  • 5 Stars
  • 71 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Cropp

Laravel 5 package for image manipulations on-the-fly., (*1)

Installation

You can install the package through Composer., (*2)

composer require yaro/cropp

You must install this service provider., (*3)

// Laravel 5: config/app.php
'providers' => [
    //...
    Yaro\Cropp\ServiceProvider::class,
    //...
];

Then publish the config file of the package using artisan., (*4)

php artisan vendor:publish --provider="Yaro\Cropp\ServiceProvider"

This package comes with Intervention Image package, so publish its configs too., (*5)

php artisan vendor:publish --provider="Intervention\Image\ImageServiceProviderLaravel5"

There is no need to add Intervention Image service provider in 'providers' array., (*6)

Usage

Simple wrap ypur image source on cropp function and call api methods., (*7)

<img src="{{ cropp('image.jpg')->invert()->fit(320, 200) }}" />
// <img src="http://example.com/storage/cropp/61bb83eae21cb5559fe0c583f14b0374.jpg">

Or not to wrap result on asset:, (*8)

<img src="{{ cropp('image.jpg', false)->greyscale()->rotate(-45)->resize(500, null) }}" />
// <img src="/storage/cropp/44aead54d338966bca06535d34edc3ae.jpg">

To get generated source path use src method:, (*9)

$thumbPath = cropp('image.jpg')->invert()->fit(320, 200)->src();

You can also initialise Cropp without helper function:, (*10)

use Yaro\Cropp\Cropp;

$cropp = new Cropp('image.jpg', false);
$src = $cropp->fit(320, 200)->src(); 
echo $src; // /storage/cropp/44aead54d338966bca06535d34edc3ae.jpg
// or
$src = Cropp::make('image.jpg')->fit(320, 200)->src();
echo $src; // http://example.com/storage/cropp/61bb83eae21cb5559fe0c583f14b0374.jpg

API

All manipulation methods is provided by Intervention Image package., (*11)

License

The MIT License (MIT). Please see LICENSE for more information., (*12)

The Versions

31/01 2016

dev-master

9999999-dev

Image manipulations on-the-fly for Laravel 5

  Sources   Download

MIT

The Requires

 

laravel image thumb manipulations

31/01 2016

0.1.1

0.1.1.0

Image manipulations on-the-fly for Laravel 5

  Sources   Download

MIT

The Requires

 

laravel image thumb manipulations

16/07 2015

0.1.0

0.1.0.0

Image manipulations on-the-fly for Laravel 5

  Sources   Download

MIT

The Requires

 

laravel image thumb manipulations

12/07 2015

0.0.1

0.0.1.0

Image manipulations on-the-fly for Laravel 5

  Sources   Download

MIT

The Requires

 

laravel image thumb manipulations