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

Adds QR code generation for sends #31

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xxxserxxx
Copy link

This implements #28. I've done no testing on mobile, but:

  1. It uses a QR library from rsc, which has no C dependencies
  2. It works running the patched app on my laptop, generating QR codes, and receiving (by scannang the codes) from the wormhole-william-mobile app on my phone
  3. I have no reason to expect -- given the simplicity of my changes, and of rsc's QR library -- that it won't work once it's on a mobile device

The QR codes are small, but they scan, and it works as-is. I don't have the Android SDK currently installed on my laptop because it's enormous.

Anyhoo, you said you'd be happy to have a patch for #28, so here it is.

@psanford
Copy link
Owner

Thanks for this! Overall the code looks good.

It doesn't look like the QR code is being hidden after the transfer has begun. We should use the same logic used for showing and hiding the text transfer code.

The QR code ends up looking blurry on my phone (it still scans). I'm not sure what the cause of that is but it seems like that should be fixable. I think we should also make the image larger. Either some reasonable minimal width or size it based on the size of the viewport.

@xxxserxxx
Copy link
Author

I am very unfamiliar with the gioui library, and it's not a trivial library to get into, so I was trying to make the patch as small as possible.

I see what you mean about hiding the QR. Noted.

There's a scaling variable in the QR library (used at ui/ui.go#251), but it doesn't actually scale the pixels; it just makes the image bounds larger. I'm either missing something in the lib API, or we have to manually scale the image.

I see a fuzzy QR as well on the desktop. The only thing I can think that would cause blurriness is if something in the image processing was resulting in a lossy image. It might be worth running a test on the qr library by itself and see how the images it produces look without being filtered through gioui.

I'm going to be unable to work on this for another week or so, but I'll poke around with it when I get back.

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

Successfully merging this pull request may close these issues.

2 participants