Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/spatie/laravel-glide
Easily convert images with Glide
https://github.com/spatie/laravel-glide
convert glide image laravel manipulate php
Last synced: 4 days ago
JSON representation
Easily convert images with Glide
- Host: GitHub
- URL: https://github.com/spatie/laravel-glide
- Owner: spatie
- License: mit
- Created: 2015-01-19T18:07:18.000Z (almost 10 years ago)
- Default Branch: main
- Last Pushed: 2024-03-23T06:47:43.000Z (9 months ago)
- Last Synced: 2024-07-31T18:16:25.081Z (4 months ago)
- Topics: convert, glide, image, laravel, manipulate, php
- Language: PHP
- Homepage: https://freek.dev/2015/12/easily-convert-images-with-glide/
- Size: 842 KB
- Stars: 420
- Watchers: 16
- Forks: 51
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
- awesome-laravel-framework - Laravel Glide - Easily convert images with Glide (Popular Packages)
- awesome-laravel - Laravel Glide - Convierta imágenes fácilmente con Glide (Paquetes utiles)
- laravel-awesome - Laravel Glide - Easily convert images with Glide (Popular Packages)
- awesome-laravel - Laravel Glide - Easily convert images with Glide (Popular Packages)
README
# Easily convert images with Glide
[![Latest Version](https://img.shields.io/github/release/spatie/laravel-glide.svg?style=flat-square)](https://github.com/spatie/laravel-glide/releases)
[![run-tests](https://github.com/spatie/laravel-glide/actions/workflows/run-tests.yml/badge.svg)](https://github.com/spatie/laravel-glide/actions/workflows/run-tests.yml)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
[![Total Downloads](https://img.shields.io/packagist/dt/spatie/laravel-glide.svg?style=flat-square)](https://packagist.org/packages/spatie/laravel-glide)This package provides an easy to use class to manipulate images. Under the hood it leverages [Glide](http://glide.thephpleague.com/) to perform
the manipulations.Here's an example of how the package can be used:
```php
GlideImage::create($pathToImage)
->modify(['w'=> 50, 'filt'=>'greyscale'])
->save($pathToWhereToSaveTheManipulatedImage);
```## Support us
Learn how to create a package like this one, by watching our premium video course:
[![Laravel Package training](https://spatie.be/github/package-training.jpg)](https://laravelpackage.training)
We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).
We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).
## Installation
You can install the package through Composer.
```bash
composer require spatie/laravel-glide
```In Laravel 5.5 the service provider and facade will automatically get registered. In older versions of the framework just add the service provider and facade in `config/app.php` file:
```php
'providers' => [
...
Spatie\Glide\GlideServiceProvider::class,
...
];...
'aliases' => [
...
'GlideImage' => Spatie\Glide\GlideImageFacade::class,
...
]
```You can publish the config file of the package using artisan.
```bash
php artisan vendor:publish --provider="Spatie\Glide\GlideServiceProvider"
```The config file looks like this:
```php'gd',
];```
## UsageHere's a quick example that shows how an image can be modified:
```php
GlideImage::create($pathToImage)
->modify(['w'=> 50, 'filt'=>'greyscale'])
->save($pathToWhereToSaveTheManipulatedImage);
```Take a look at [Glide's image API](http://glide.thephpleague.com/1.0/api/quick-reference/) to see which parameters you can pass to the `modify`-method.
## Testing
You can run the tests with:
```bash
composer test
```### Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
## 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.
- [Version 2 branch with Laravel 5 support](https://github.com/spatie/laravel-glide/tree/v2)
- [Version 1 branch with Laravel 4 support](https://github.com/spatie/laravel-glide/tree/laravel-4)### Security
If you've found a bug regarding security please mail [[email protected]](mailto:[email protected]) instead of using the issue tracker.
## Credits
- [Freek Van der Herten](https:/murze.be)
- [All Contributors](https://github.com/freekmurze/laravel-glide/contributors)## License
The MIT License (MIT). Please see [LICENSE](https://github.com/freekmurze/laravel-glide/blob/master/LICENSE) for more information.