Easily convert images with Glide
PHP
Latest commit 0c2430a Jul 29, 2016 @freekmurze freekmurze committed on GitHub Update README.md
Permalink
Failed to load latest commit information.
config fixes for the mandatory nitpicks Dec 29, 2015
src refactor watermark fix May 5, 2016
tests/Integration fix tests May 5, 2016
.editorconfig wip Dec 27, 2015
.gitattributes wip Dec 27, 2015
.gitignore wip Dec 27, 2015
.scrutinizer.yml wip Dec 27, 2015
.travis.yml Update .travis.yml Dec 29, 2015
CHANGELOG.md edit changelog May 5, 2016
CONTRIBUTING.md wip Dec 27, 2015
LICENSE Initial commit Jan 19, 2015
README.md Update README.md Jul 29, 2016
composer.json update description Dec 29, 2015
phpunit.xml.dist update readme Dec 29, 2015

README.md

Easily convert images with Glide

Latest Version Build status SensioLabsInsight Quality Score Software License Total Downloads

This package provides an easy to use class to manipulate images. Under the hood it leverages Glide to perform the manipulations.

Here's an example of how the package can be used:

GlideImage::create($pathToImage)
    ->modify(['w'=> 50, 'filt'=>'greyscale'])
    ->save($pathToWhereToSaveTheManipulatedImage);

Spatie is a webdesign agency in Antwerp, Belgium. You'll find an overview of all our open source projects on our website.

Postcardware

You're free to use this package (it's MIT-licensed), but if it makes it to your production environment you are required to send us a postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: Spatie, Samberstraat 69D, 2060 Antwerp, Belgium.

The best postcards will get published on the open source page on our website.

Installation

You can install the package through Composer.

composer require spatie/laravel-glide

You must install this service provider.


// config/app.php

'providers' => [
    ...
    Spatie\Glide\GlideServiceProvider::class,
    ...
];

This package also comes with a facade, which provides an easy way to generate images.


// config/app.php

'aliases' => [
    ...
    'GlideImage' => Spatie\Glide\GlideImageFacade::class,
    ...
]

You can publish the config file of the package using artisan.

php artisan vendor:publish --provider="Spatie\Glide\GlideServiceProvider"

The config file looks like this:


<?php

return [

    /*
     * The driver that will be used to create images. Can be set to gd or imagick.
     */
    'driver' => 'gd',
];

Usage

Here's a quick example that shows how an image can be modified:

GlideImage::create($pathToImage)
    ->modify(['w'=> 50, 'filt'=>'greyscale'])
    ->save($pathToWhereToSaveTheManipulatedImage);

Take a look at Glide's image API to see which parameters you can pass to the modify-method.

Testing

You can run the tests with:

composer test

Previous versions

Previous versions of this package had PHP 5.4 support and the ability to generate images on the fly from an url.

The previous versions are unsupported, but they should still work in your older projects.

Credits

About Spatie

Spatie is a webdesign agency in Antwerp, Belgium. You'll find an overview of all our open source projects on our website.

License

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