mirror of
https://github.com/covidpass-org/covidpass.git
synced 2025-02-23 15:07:44 +01:00
specify error correction level of QR code in photos to make it compatible with BC scanner app
This commit is contained in:
parent
0e53240dd0
commit
9c2130ba2d
@ -5,6 +5,7 @@ import {BrowserQRCodeSvgWriter} from "@zxing/browser";
|
||||
import { toPng, toJpeg, toBlob, toPixelData, toSvg } from 'html-to-image';
|
||||
import * as Sentry from '@sentry/react';
|
||||
import {QrCode,Encoding,PackageResult,QrFormat,PassPhotoCommon} from './passphoto-common';
|
||||
import { EncodeHintType } from "@zxing/library";
|
||||
|
||||
export class Photo {
|
||||
|
||||
@ -67,7 +68,8 @@ export class Photo {
|
||||
}
|
||||
|
||||
const codeWriter = new BrowserQRCodeSvgWriter();
|
||||
const svg = codeWriter.write(qrCode.message,200,200);
|
||||
const hints : Map<EncodeHintType,any> = new Map().set(EncodeHintType.ERROR_CORRECTION,'M');
|
||||
const svg = codeWriter.write(qrCode.message,200,200, hints);
|
||||
svg.setAttribute('style','background-color: white');
|
||||
document.getElementById('qrcode').appendChild(svg);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user