Last active
September 29, 2022 11:47
-
-
Save alchemydigital/ab0eb238910e9c8a18c4 to your computer and use it in GitHub Desktop.
Manually instantiating Glide using a different class (use with this Gist - https://gist.github.com/alchemydigital/2e3a2b7261e36003e42f). Basically the same as the manual setup in the docs, except with a different Server class - http://glide.thephpleague.com/config/the-server/.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Set image source | |
$source = new League\Flysystem\Filesystem( | |
new League\Flysystem\Adapter\Local('path/to/source/folder') | |
); | |
// Set image cache | |
$cache = new League\Flysystem\Filesystem( | |
new League\Flysystem\Adapter\Local('path/to/cache/folder') | |
); | |
// Set image manager | |
$imageManager = new Intervention\Image\ImageManager([ | |
'driver' => 'imagick', | |
]); | |
// Set manipulators | |
$manipulators = [ | |
new League\Glide\Api\Manipulator\Orientation(), | |
new League\Glide\Api\Manipulator\Rectangle(), | |
new League\Glide\Api\Manipulator\Size(2000*2000), | |
new League\Glide\Api\Manipulator\Brightness(), | |
new League\Glide\Api\Manipulator\Contrast(), | |
new League\Glide\Api\Manipulator\Gamma(), | |
new League\Glide\Api\Manipulator\Sharpen(), | |
new League\Glide\Api\Manipulator\Filter(), | |
new League\Glide\Api\Manipulator\Blur(), | |
new League\Glide\Api\Manipulator\Pixelate(), | |
new League\Glide\Api\Manipulator\Output(), | |
]; | |
// Set API | |
$api = new League\Glide\Api\Api($imageManager, $manipulators); | |
// Setup Glide server | |
$server = new Your\App\Namespace\Server($source, $cache, $api); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment