-
Notifications
You must be signed in to change notification settings - Fork 286
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
Have quirc run in the browser by compiling to web assembly #76
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
move to rgba for input Approved-by: Jaap Haitsma <jaap@haitsma.org>
On Mon, May 18, 2020 at 08:47:19PM -0700, JaapHaitsma wrote:
You need to install emscripten See: https://emscripten.org/docs/getting_started/downloads.html
After that run
`make quirc.js`
Then serve the js directory in a webserver and open demo.html in your browser and you will see that your browser recognized the QR code
I made also PWA app that uses the the js library. Open it with your phone https://qrcode-quirc.glitch.me/ It also works offline and you can install it. The only I still need to do is show the detected QR code in a nice interface. If you click on the QR code icon it will copy it to the clipboard.
If you are interested in the code of the app you can find it here https://glitch.com/edit/#!/qrcode-quirc?path=script.js%3A1%3A0
Nice thing is that because all the heavylifting is in the wasm engine that it runs quite smoothly even on an older mid range processor like a snapdragon 625
What I did in a nutshell to get quirc in the browser
- Add a cpp wrapper to quirc
- Make a webidl file such that emscripten knows how to map cpp class to javascript
- Build the wasm and corresponding js binding with emscripten
- Write a wrapper QuircJS.js around this to make using the resulting library easier
This looks interesting and useful, but I'm not sure that I'd be able to
maintain it as quirc changes.
Would it be feasible to start a separate project to maintain the
bindings and build rules?
Cheers,
Daniel
…--
Daniel Beer <dlbeer@gmail.com> http://dlbeer.co.nz/
PGP: BA6E 0B26 1F89 246C E3F3 C910 1E58 C43A 160A 553B
|
Hi Daniel,
I can help you maintain it in your repo. Maintenance should be very low. I
just have a CPP wrapper around your public API. So only if you change the
public API there would be a need to do changes in my code. However if you
prefer I can make a QuircJS project that pulls in quirc as a submodule.
Let me know what you think is the best
Jaap
On Sun, May 24, 2020 at 10:06 PM Daniel Beer <notifications@github.com>
wrote:
… On Mon, May 18, 2020 at 08:47:19PM -0700, JaapHaitsma wrote:
> You need to install emscripten See:
https://emscripten.org/docs/getting_started/downloads.html
>
> After that run
> `make quirc.js`
>
> Then serve the js directory in a webserver and open demo.html in your
browser and you will see that your browser recognized the QR code
>
> I made also PWA app that uses the the js library. Open it with your
phone https://qrcode-quirc.glitch.me/ It also works offline and you can
install it. The only I still need to do is show the detected QR code in a
nice interface. If you click on the QR code icon it will copy it to the
clipboard.
> If you are interested in the code of the app you can find it here
https://glitch.com/edit/#!/qrcode-quirc?path=script.js%3A1%3A0
>
> Nice thing is that because all the heavylifting is in the wasm engine
that it runs quite smoothly even on an older mid range processor like a
snapdragon 625
>
>
> What I did in a nutshell to get quirc in the browser
> - Add a cpp wrapper to quirc
> - Make a webidl file such that emscripten knows how to map cpp class to
javascript
> - Build the wasm and corresponding js binding with emscripten
> - Write a wrapper QuircJS.js around this to make using the resulting
library easier
This looks interesting and useful, but I'm not sure that I'd be able to
maintain it as quirc changes.
Would it be feasible to start a separate project to maintain the
bindings and build rules?
Cheers,
Daniel
--
Daniel Beer ***@***.***> http://dlbeer.co.nz/
PGP: BA6E 0B26 1F89 246C E3F3 C910 1E58 C43A 160A 553B
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#76 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAG5AT2HA235JLW32SSX42TRTHHC3ANCNFSM4NEUBMKQ>
.
|
On Mon, May 25, 2020 at 08:32:46AM -0700, JaapHaitsma wrote:
I can help you maintain it in your repo. Maintenance should be very low. I
just have a CPP wrapper around your public API. So only if you change the
public API there would be a need to do changes in my code. However if you
prefer I can make a QuircJS project that pulls in quirc as a submodule.
Let me know what you think is the best
I think it's probably cleaner to maintain it as a separate repository
pulling in a submodule -- then you'd be free to pull in whatever tooling
you like. Currently, I'd prefer to keep the core library dependent on as
few tools and libraries as possible as it needs to run on a wide variety
of platforms.
Cheers,
Daniel
…--
Daniel Beer <dlbeer@gmail.com> http://dlbeer.co.nz/
PGP: BA6E 0B26 1F89 246C E3F3 C910 1E58 C43A 160A 553B
|
Daniel, I made a separate repo https://github.com/JaapHaitsma/QuircJS where I put quirc as submodule. So closing this merge request. |
Should we have a list of theses type of projects, i.e. "versions" of quirc, in the README? |
On Tue, May 26, 2020 at 01:33:05AM -0700, Alexandre Perrin wrote:
Should we have a list of theses type of projects, i.e. "versions" of quirc, in the README?
That would probably be a good idea, if you're happy to compile the list!
…--
Daniel Beer <dlbeer@gmail.com> http://dlbeer.co.nz/
PGP: BA6E 0B26 1F89 246C E3F3 C910 1E58 C43A 160A 553B
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
You need to install emscripten See: https://emscripten.org/docs/getting_started/downloads.html
After that run
make quirc.js
Then serve the js directory in a webserver and open demo.html in your browser and you will see that your browser recognized the QR code
I made also PWA app that uses the the js library. Open it with your phone https://qrcode-quirc.glitch.me/ It also works offline and you can install it. The only I still need to do is show the detected QR code in a nice interface. If you click on the QR code icon it will copy it to the clipboard.
If you are interested in the code of the app you can find it here https://glitch.com/edit/#!/qrcode-quirc?path=script.js%3A1%3A0
Nice thing is that because all the heavylifting is in the wasm engine that it runs quite smoothly even on an older mid range processor like a snapdragon 625
What I did in a nutshell to get quirc in the browser