PHP code example of freshleafmedia / glide-dimension-watermark
1. Go to this page and download the library: Download freshleafmedia/glide-dimension-watermark library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
freshleafmedia / glide-dimension-watermark example snippets
use Freshleafmedia\DimensionWatermark\DimensionWatermark;
// Setup Glide server. See https://glide.thephpleague.com/2.0/simple-example/
$server = League\Glide\ServerFactory::create([
// ...
]);
// Add DimensionWatermark to the manipulators array
$manipulators = $server->getApi()->getManipulators();
array_splice($manipulators, count($manipulators) - 1, 0, [new DimensionWatermark()]);
$server->getApi()->setManipulators($manipulators);