mrofi / laravel-glide by mrofi
forked from spatie/laravel-glide

Easily convert images with Glide (refork from spatie/laravel-glide) But this repo dedicated for php 5.x :). Dont forget to use dev-master
19
0
2
Package Data
Maintainer Username: mrofi
Maintainer Contact: freek@spatie.be (Freek Van der Herten)
Package Create Date: 2016-05-07
Package Last Update: 2016-05-07
Home Page: https://murze.be/2015/12/easily-convert-images-with-glide/
Language: PHP
License: MIT
Last Refreshed: 2024-11-19 03:17:57
Package Statistics
Total Downloads: 19
Monthly Downloads: 1
Daily Downloads: 0
Total Stars: 0
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0

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.

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.