It’s probably a newbie question. But after developing several projects in YII2 he had never had a need to use Imagick directly.
So I installed Imagick the latest version in my local environment (Wamp) and for testing I made a simple file.
<?php
$imagen = new Imagick($_SERVER['DOCUMENT_ROOT'] . '/prueba_imagick/ejemplo.png');
$imagen->thumbnailImage(100,0);
$orientation = $imagen->getImageOrientation();
switch ($orientation) {
case 8:
$imagen->rotateimage("#000", -90);
break;
case 3:
$imagen->rotateimage("#000", 180);
break;
case 6:
$imagen->rotateimage("#000", 90);
break;
}
$imagen->writeImages($_SERVER['DOCUMENT_ROOT'] . '/prueba_imagick/imagen4.png', true);
?>
Then I tried to replicate the same in my yii2 project, advanced template and I get the following error.
## Class 'common\components\Imagick' not found
Please see my screenshot
Thank you very much for your help