Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QR Code will not resize on Google Pixel 5/6 #290

Open
Spederan opened this issue Jan 26, 2023 · 2 comments
Open

QR Code will not resize on Google Pixel 5/6 #290

Spederan opened this issue Jan 26, 2023 · 2 comments

Comments

@Spederan
Copy link

Spederan commented Jan 26, 2023

Ive tested it across multiple devices, and it will not set itself to the correct size when resized on a Google pixel 5 or 6, but works fine on everything else. This makes my QR codes too large.

@almatrass
Copy link

I'm assuming you're generating a bigger QR code, then sizing it using CSS.

On some devices the QR code is generated as a <canvas> element, not as an image.

This means you'll need to apply the CSS to both the image and canvas to ensure it works on all devices:

#qrcode img, #qrcode canvas {
    width: 250px;
    height: 250px;
}

@carl2049
Copy link

carl2049 commented Apr 27, 2023

Give #qrcode div a certain width, then:

#qrcode img, #qrcode canvas {
width: 100%; height: auto;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants