PHP code example of mwarcz / segami
1. Go to this page and download the library: Download mwarcz/segami 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/ */
mwarcz / segami example snippets
$segami = new Segami([
// Selected path to dir with original images
'path_to_original_images' => __DIR__ . '/original',
// Selected path to dir with generated images
'path_to_generated_images' => __DIR__ . '/generated',
// Selected plugins for generating images
'plugin' => [
// CorePlugin is ter' => new FreeImageLimiter(),
// Selected image engine
'image_factory' => new ImageImagickFactory(),
// Selected logger for logging access to images
'image_logger' => new ImageLoggerNone(),
]);
try {
$segami->smartReturnImage($_GET['image'], isset($_GET['cache']));
} catch (\Throwable $e) {
http_response_code(404);
}