1
0
Fork 0
mirror of synced 2024-06-28 11:10:46 +12:00

Fixed resizing

This commit is contained in:
Eldad Fux 2021-01-10 02:17:44 +02:00
parent bdd04ce292
commit 71036ba85f

View file

@ -386,7 +386,6 @@ App::get('/v1/avatars/qr')
'addQuietzone' => true,
'quietzoneSize' => $margin,
'outputType' => QRCode::OUTPUT_IMAGICK,
'pngCompression' => 9,
]);
$qrcode = new QRCode($options);
@ -395,10 +394,14 @@ App::get('/v1/avatars/qr')
$response->addHeader('Content-Disposition', 'attachment; filename="qr.png"');
}
$resize = new Resize($qrcode->render($text));
$resize->crop((int) $size, (int) $size);
$response
->addHeader('Expires', \date('D, d M Y H:i:s', \time() + (60 * 60 * 24 * 45)).' GMT') // 45 days cache
->setContentType('image/png')
->send($qrcode->render($text))
->send($resize->output('png', 9))
;
});