Replies: 2 comments 5 replies
-
Hmm why would you try to output SVG via ImageMagick when you could use the SVG output instead? Rendering/converting SVG via IM is generally not recommended - you could use the InkScape command line interface for proper conversion. Also, with your current settings you could just use the PNG output instead. |
Beta Was this translation helpful? Give feedback.
5 replies
-
Final solution: $options = new QROptions([
'imageBase64' => false,
'outputType' => QRCode::OUTPUT_IMAGICK,
'eccLevel' => QRCode::ECC_M,
'returnResource' => true,
'imageTransparent' => true,
'addQuietzone' => false,
'markupLight' => 'rgba(0,0,0,0)',
'markupDark' => '#000000',
]);
$qr = new QRCode($options);
/** @var \Imagick */
$img = $qr->render($content);
$img->setImageFormat('png');
$img->resizeImage($size, $size, \Imagick::FILTER_GAUSSIAN, 0.1);
$img->setOption('png:compression-level', 6);
// Laravel can only display saved files
return $img->writeImage($file->path); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the bug
I am trying to process the Imagick image after generation but with no possible option it seems right for me.
I have the imagick ext installed on PHP 8.1 and "libmagickcore-dev" (seems the one with SVG support).
This is the cachefile output:
This is the output SVG from Imagick:
Code sample
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
Additional context
Add any other context about the problem here.
Beta Was this translation helpful? Give feedback.
All reactions