Пример #1
0
<?php

$loader = (require __DIR__ . "/../vendor/autoload.php");
$loader->addPsr4('Imagecraft\\', __DIR__);
\TranslatedException\TranslatedException::init();
\ImcStream\ImcStream::register();
date_default_timezone_set('UTC');
 /**
  * @param PhpGdEvent
  */
 public function termImcUri(PhpGdEvent $event)
 {
     $layers = $event->getLayers();
     foreach ($layers as $key => $layer) {
         if (!$layer instanceof ImageAwareLayerInterface) {
             continue;
         }
         if ($layer->has('image.imc_uri')) {
             ImcStream::fclose($layer->get('image.imc_uri'));
             $layer->remove('image.imc_uri');
         }
     }
 }