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

Make QR code background white #5256

Closed
link2xt opened this issue Feb 8, 2024 · 12 comments
Closed

Make QR code background white #5256

link2xt opened this issue Feb 8, 2024 · 12 comments

Comments

@link2xt
Copy link
Collaborator

link2xt commented Feb 8, 2024

This should make scanning it easier, currently it is black on gray.

See discussion on https://support.delta.chat/t/error-qr-code-could-not-be-decoded/2923/6

@Simon-Laux
Copy link
Member

if this is an issue it would be a core issue, because the svg is generated there (I don't think desktop modifies it in any way).

But as I said in the forum I think this should be treated as a problem in the android scanning library, maybe additionally make a pass with https://github.com/dignifiedquire/quircs/tree/master when updating or changing settings does not help.

@link2xt
Copy link
Collaborator Author

link2xt commented Feb 9, 2024

I think in the core it is transparent, because on Android background is white.

@link2xt
Copy link
Collaborator Author

link2xt commented Feb 9, 2024

But we can also add a white rectangle behind in the core.

@link2xt link2xt transferred this issue from deltachat/deltachat-desktop Feb 9, 2024
@r10s
Copy link
Member

r10s commented Feb 9, 2024

it is a very light gray also on ios, tbh, nothing that should disturb, there is still lots of contrast. maybe a very bad qr code scanner?

before making things less nice, we should test by gimp-fill-with-white if that really helps on the issue reported in the forum.

esp. as also avatar and mirroring is mentioned as possible causes.

@link2xt
Copy link
Collaborator Author

link2xt commented Feb 9, 2024

maybe a very bad qr code scanner?

Android QR code scanning library is very bad at scanning, yes.

@Raiden-GH
Copy link

My inexpensive Android phone sometimes also has problems with QR codes.
After one or two attempts, it works. Maybe the problem is caused by cheap cameras?
This could be the reason why some apps increase the screen brightness when displaying QR codes.

@Simon-Laux
Copy link
Member

Simon-Laux commented Feb 9, 2024

We could add https://github.com/dignifiedquire/quircs to core to easily make it accessible on android (without adding another native lib to the built process). as I told on the forum that library can scan the qr code in question with no problems. Maybe we can use both scanner libraries in tandem/parallel for better results?

Or on newer phones there could also be a google/android provided system library/sdk for scanning qr codes? the Chrome browser has one, so android might too?

@link2xt
Copy link
Collaborator Author

link2xt commented Feb 9, 2024

Maybe the problem is caused by cheap cameras?

If you see the QR code in camera and can reconstruct original one cell-by-cell in graphical editor, then QR code scanning software should be able to do it too. In practice it is much worse than that.

@iequidoo iequidoo self-assigned this Feb 24, 2024
@iequidoo
Copy link
Collaborator

iequidoo commented Feb 24, 2024

I think in the core it is transparent, because on Android background is white.

It's #f2f2f2 in the core and on Android too, i even checked it making a screenshot. So, almost white. I'd suggest to make it #ffffff however. And IDK why it's so gray in Desktop.

EDIT: As Simon-Laux noted below, it's really an optical illusion in Desktop light mode, the color is the same.

@Simon-Laux
Copy link
Member

Simon-Laux commented Feb 24, 2024

And IDK why it's so gray in Desktop.

It's the same in desktop, it is an optical illusion if you use desktop in light mode and android in dark mode or android background is not really white, I don't know, because I used android also in dark mode.

I suggest to solve the real problem which is the qr code scanner on android that is not good enough.
Please don't change the color before actually testing if it does anything, which I expect not, as the contrast is probably still high enough.
Solving the underlying problem of the bad scanner will also solve other issues, maybe it is because of the special perspective or the blurriness of the test image.

@iequidoo iequidoo removed their assignment Feb 24, 2024
@Septias
Copy link
Contributor

Septias commented Feb 26, 2024

Maybe we should close this as we cannot reproduce the problem (Bjoern on ios and Simon with quircs were both able to decode the QR code just fine). Maybe the person in question has bad camera quality, too dim monitor or maybe it's the bad qr-code reading library from Android. It feels like there are too many moving pieces and it depends very much on every person, their settings, and their phone. I think it works well in general and these are only rare occasions.

@Septias
Copy link
Contributor

Septias commented Feb 26, 2024

It would be very easy to change the background btw:

d.attr("style", "fill:#f2f2f2")?;

@Septias Septias closed this as completed Feb 27, 2024
@link2xt link2xt closed this as not planned Won't fix, can't repro, duplicate, stale Feb 27, 2024
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

6 participants