Change QR code output to SVG to avoid GD dependency; fix permissions for uploads

This commit is contained in:
Edwin Noorlander 2025-11-11 18:02:19 +01:00
parent ef5bf3ecca
commit 9fb5066f9b
3 changed files with 3 additions and 5 deletions

Binary file not shown.

View File

@ -171,13 +171,11 @@ class ItemController
mkdir($qrDir, 0755, true);
}
$options = new QROptions([
'outputType' => QRCode::OUTPUT_IMAGE_PNG,
'outputType' => QRCode::OUTPUT_MARKUP_SVG,
'eccLevel' => QRCode::ECC_L,
'imageTransparent' => false,
'imageBase64' => false,
]);
$qrCode = new QRCode($options);
$qrCode->render($idCode, $qrDir . $idCode . '.png');
$qrCode->render($idCode, $qrDir . $idCode . '.svg');
}
public static function printQR($id) {

View File

@ -17,7 +17,7 @@
<div class="qr-container">
<h2>{{ item.name }}</h2>
<p>ID Code: {{ item.id_code }}</p>
<img src="/uploads/qr/{{ item.id_code }}.png" alt="QR Code" class="qr-code">
<img src="/uploads/qr/{{ item.id_code }}.svg" alt="QR Code" class="qr-code">
<div class="details">
<p><strong>Description:</strong> {{ item.description }}</p>
<p><strong>Category:</strong> {{ item.category_path ?: 'Uncategorized' }}</p>