Fix QR generation using save method

This commit is contained in:
Edwin Noorlander 2025-11-11 18:24:53 +01:00
parent 81fca09069
commit b06207810b

View File

@ -177,15 +177,11 @@ class ItemController
mkdir($qrDir, 0755, true);
}
$options = new QROptions([
'outputType' => QRCode::OUTPUT_MARKUP_SVG,
'outputType' => QRCode::OUTPUT_SVG,
'eccLevel' => QRCode::ECC_L,
]);
$qrCode = new QRCode($options);
$svg = $qrCode->render($idCode);
if (strpos($svg, 'data:image/svg+xml;base64,') === 0) {
$svg = base64_decode(substr($svg, 26)); // 26 is length of 'data:image/svg+xml;base64,'
}
file_put_contents($qrDir . $idCode . '.svg', $svg);
$qrCode->render($idCode, $qrDir . $idCode . '.svg');
}
public static function printQR($id) {