Closed reshmindp closed 1 year ago
You need to install imagick or use svg qrcodes.
Not so easy. Same error on Laravel 9/10, PHP 8.0, 8.1, 8.2 , MacOS 12 , Laravel Valet 4.5.0 simple-qrcode ^4.2
Imagick installed (PHP Monitor) #1:
ImageMagickBackEnd.php in bacon-qrcode, drops exception:
public function __construct(string $imageFormat = 'png', int $compressionQuality = 100)
{
if (! class_exists(Imagick::class)) {
throw new RuntimeException('You need to install the imagick extension to use this back end');
}
...
original call:
QrCode::format('png')->size(300)->margin(3)->generate($this->qrcode, $qrcode_image_path);
So any idea?
EDIT: if I directly call the bacon qrcode in the project, it works, creates the png:
Route::get('qrtest', function(){
$renderer = new ImageRenderer(
new RendererStyle(400),
new ImagickImageBackEnd()
);
$writer = new Writer($renderer);
$writer->writeFile('Hello World!', base_path('qrcode2.png'));
});
Same issue here, same php and laravel version!
When trying to create QR code using simplesoftwareio/simple-qrcode 4.2 getting the below error. Please fix this support issue. BaconQrCode\Exception\RuntimeException: You need to install the imagick extension to use this back end in file