mirror of
https://github.com/LinkStackOrg/LinkStack.git
synced 2025-02-13 10:30:56 +01:00
Refactor QR code generation - disable png codes for faster load times
This commit is contained in:
parent
7e84a7685f
commit
3019efef0d
@ -686,17 +686,10 @@ $usrhandl = Auth::user()->littlelink_name;
|
||||
$argValues = config('advanced-config.qr_code_gradient') ?? [0, 0, 0, 0, 0, 0, 'diagonal'];
|
||||
list($arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $arg7) = $argValues;
|
||||
|
||||
if (extension_loaded('imagick')) {
|
||||
$imgSrc = QrCode::format('png')->gradient($arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $arg7)->eye('circle')->style('round')->size(1000)->generate($redirectURL);
|
||||
$imgSrc = base64_encode($imgSrc);
|
||||
$imgSrc = 'data:image/png;base64,' . $imgSrc;
|
||||
$imgType = 'png';
|
||||
} else {
|
||||
$imgSrc = QrCode::gradient($arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $arg7)->eye('circle')->style('round')->size(1000)->generate($redirectURL);
|
||||
$imgSrc = base64_encode($imgSrc);
|
||||
$imgSrc = 'data:image/svg+xml;base64,' . $imgSrc;
|
||||
$imgType = 'svg';
|
||||
}
|
||||
|
||||
} catch(exception $e) {
|
||||
$imgSrc = url('/assets/linkstack/images/themes/no-preview.png');
|
||||
|
Loading…
x
Reference in New Issue
Block a user