orchestral / imagine by crynobone

Imagine (Wrapper) Component for Laravel 5
175,680
67
6
Package Data
Maintainer Username: crynobone
Maintainer Contact: crynobone@gmail.com (Mior Muhammad Zaki)
Package Create Date: 2013-09-09
Package Last Update: 2021-04-17
Home Page: https://packagist.org/packages/orchestra/imagine
Language: PHP
License: MIT
Last Refreshed: 2024-11-17 03:04:24
Package Statistics
Total Downloads: 175,680
Monthly Downloads: 512
Daily Downloads: 3
Total Stars: 67
Total Watchers: 6
Total Forks: 13
Total Open Issues: 1

Imagine (Wrapper) Component for Laravel 5

Imagine (Wrapper) Component is a Laravel 5 package wrapper for Imagine.

Build Status Latest Stable Version Total Downloads Latest Unstable Version License

Table of Content

Version Compatibility

Laravel | Imagine :----------|:---------- 5.5.x | 3.5.x 5.6.x | 3.6.x 5.7.x | 3.7.x 5.8.x | 3.8.x 5.9.x | 3.9.x@dev

Installation

To install through composer, simply put the following in your composer.json file:

{
    "require": {
        "orchestra/imagine": "^3.5"
    }
}

And then run composer install from the terminal.

Quick Installation

Above installation can also be simplify by using the following command:

composer require "orchestra/imagine=^3.5"

Configuration

Add Orchestra\Imagine\ImagineServiceProvider service provider in config/app.php.

'providers' => [

    // ...

    Orchestra\Imagine\ImagineServiceProvider::class,
],

Add Imagine alias in config/app.php.

'aliases' => [

    // ...

    'Imagine' => Orchestra\Imagine\Facade::class,
],

Usage

Here a simple example how to create a thumbnail from an image:

<?php

use Imagine\Image\ImageInterface;
use Orchestra\Imagine\Jobs\CreateThumbnail;

dispatch(new CreateThumbnail([
    'path' => $path,
    'filename' => $filename, // filename without extension
    'extension' => $extension,
    'format' => '{filename}.thumb.{extension}',
    'dimension' => 320, // width and height will be 320.
    'mode' => ImageInterface::THUMBNAIL_OUTBOUND,
    'filter' => ImageInterface::FILTER_UNDEFINED,
]));