1. Go to this page and download the library: Download clear01/images 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/ */
clear01 / images example snippets
composer
class ModifiersLoader implements WebChemistry\Images\Modifiers\ILoader {
public function load(WebChemistry\Images\Modifiers\ModifierContainer $modifierContainer) {
$modifierContainer->addModifier('custom', function (ModifierParam $param, $foo) {
// zpracovani obrazku $param->getImage()
});
}
}
// vytvorime zdroj pro obrazek
$resource = $storage->createUploadResource($upload);
// nebo z cesty
$resource = $storage->createLocalResource($location);
// pridame namespace
$resource->setNamespace('namespace');
// ulozime
$result = $storage->save($resource);
// zobrazime url adresu
echo $storage->link($result);
$resource->setAlias("custom");
// Kombinace více aliasů
$resource->setAliases(["custom", "custom2"]);
$id = $resource->getId(); // Ziskání id
// nebo
$id = (string) $resource;