I am working on crop image module, I need detail of uploaded image so i am using this function
$image = Image::getImagine()->open($path);
$size = $image->getSize();
While using this function it is giving me error
Class 'Imagine\Gd\Imagine' not found
case self::DRIVER_IMAGICK:
if (class_exists('Imagick', false)) {
return new \Imagine\Imagick\Imagine();
}
break;
case self::DRIVER_GD2:
if (function_exists('gd_info')) {
return new \Imagine\Gd\Imagine();
}
break;
default:
throw new InvalidConfigException("Unknown driver: $driver");
}
}
throw new InvalidConfigException("Your system does not support any of these drivers: " . implode(',', (array) static::$driver));
This error comes from it library files
vendor\yiisoft\yii2\imagine\BaseImage.php
How can i solve this issue ? Can anyone please suggest me ?
Namespace is also added
namespace yii\imagine;
use Yii;
use yii\imagine\Image\Box;
use yii\imagine\Image\Color;
use yii\imagine\Image\ImageInterface;
use yii\imagine\Image\ImagineInterface;
use yii\imagine\Image\ManipulatorInterface;
use yii\imagine\Image\Point;
use yii\base\InvalidConfigException;
use yii\base\InvalidParamException;
use yii\helpers\ArrayHelper;
This is library files, i never changed it, i also did composer update, still it is giving me same error
could be a namespece access problem try add
use yii\imagine;
to your code
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With