laravel-glide 0,0 editorconfig scrutinizer travis-ci Packagist phpunit

Easily convert images with Glide

3 years after

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.

Related Repositories

awesome-laravel

awesome-laravel

A curated list of bookmarks, packages, tutorials, videos and other cool resource ...

awesome-php

awesome-php

收集整理一些常用的PHP类库, 资源以及技巧. 以便在工作中迅速的查找所需... ...

laravel-elfinder

laravel-elfinder

elFinder bundle for Laravel ...

Elephant

Elephant

Elephant is PHPHub Community Android unofficial client, base on Material Design ...

glide-laravel

glide-laravel

Glide adapter for Laravel ...


Top Contributors

freekmurze MatthiasDeWinter lukepolo jakoblaegdsmand artemverbo JolitaGrazyte judereid Sennik Big-Shark

Dependencies

package version
php ^7.0
illuminate/support ~5.3.0|~5.4.0
league/glide ^1.0
dev phpunit/phpunit 5.*
orchestra/testbench ~3.3.0|~3.4.0

Releases

-   3.0.1 zip tar
-   3.0.0 zip tar
-   2.3.4 zip tar
-   2.3.3 zip tar
-   2.3.2 zip tar
-   2.3.1 zip tar
-   2.3.0 zip tar
-   2.2.8 zip tar
-   2.2.7 zip tar
-   2.2.6 zip tar
-   2.2.5 zip tar
-   2.2.4 zip tar
-   2.2.3 zip tar
-   2.2.2 zip tar
-   2.2.1 zip tar
-   2.2.0 zip tar
-   2.1.0 zip tar
-   2.0.2 zip tar
-   2.0.1 zip tar
-   2.0.0 zip tar
-   1.1.0 zip tar
-   1.0.0 zip tar
-   0.3.0 zip tar
-   0.2 zip tar
-   0.1 zip tar