despark/laravel-image-purify

Laravel wrapper for https://github.com/despark/image-purify
2,375 1
Install
composer require despark/laravel-image-purify
Latest Version:0.3
Laravel:5 · 6 · 7
License:MIT
Last Updated:Mar 20, 2020
Links: GitHub  ·  Packagist
Maintainer: lsimeonov

About

This package is a laravel wrapper for despark/image-purify

Installation

Get it from composer

composer require despark/laravel-image-purify

With Laravel 5.5 or newer, the package will be discovered automatically. If you're using an older version of Laravel, add the following to your config/app.php file:

$providers = [
    ...
    Despark\Laravel\ImagePurify\ImagePurifyServiceProvider::class,
]

If you want an instance of the purifier you can dependency inject Despark\ImagePurify\Interfaces\ImagePurifierInterface

If instead you want to register a facade add this to you config/app.php

$aliases = [
    ...
    'ImagePurify' => \Despark\Laravel\ImagePurify\Facades\ImagePurify::class
]

If you need custom options you can publish the config via

php artisan vendor:publish --provider "Despark\Laravel\ImagePurify\ImagePurifyServiceProvider" --tag config

Example Usage


use Despark\ImagePurify\Interfaces\ImagePurifierInterface;

class HomeController extends Controller{
    
    public function optimize(ImagePurifierInterface $purifier){
        $purifier->purify('path/to/file');
    }
}

For additional options and usage see despark/image-purify documentation.

Related Packages

4rn0/statamic-image-optimizer

Optimizes JPEG, PNG, GIF and WebP assets and Glide images with jpegoptim, pngqua...

18,341 5
justsmiletoo/laravel-file-compressor

Automatically compress images, PDFs and videos on upload in Laravel. Auto-detect...

1,241 0
henset11/image-optimizer

Optimize your Filament images before they reach your database.

2 0
joshembling/image-optimizer

Optimize your Filament images before they reach your database.

185,020 114
danihidayatx/image-optimizer

Optimize your Filament images before they reach your database. Forked from joshe...

40,173 34

Version History

Version Released Laravel License
0.3 ^5.1|^6.0|^7.0 MIT
v0.2.1 ^5.1 MIT
v0.2 5.5.*|5.4.*|5.3.*|5.2.*|5.1.* MIT
v0.1.1 5.4.*|5.3.*|5.2.*|5.1.* MIT