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

Camera QR scanner #2779

Merged
merged 11 commits into from Apr 30, 2022
Merged

Camera QR scanner #2779

merged 11 commits into from Apr 30, 2022

Conversation

rkalman
Copy link
Contributor

@rkalman rkalman commented Mar 26, 2022

#1207
I understand the need of a general purpose scanner library, and recently html5-qrcode has gained 1D barcode functionality, however I have camera handling issues during testing. The zxing lib would be a great choice.

But if someone like to use a camera scanner with the internally generated QR codes only, maybe a lightweight solution like this is acceptable.

requirements.txt Outdated
@@ -24,6 +24,7 @@ django-mptt==0.11.0 # Modified Preorder Tree Traversal
django-redis>=5.0.0
django-q==1.3.4 # Background task scheduling
django-sql-utils==0.5.0 # Advanced query annotation / aggregation
django-sslserver==0.22 # Secure HTTP development server
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this package added?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pages have to be served over https in order to access the camera, so I needed a simple way to spin up a development server.

@matmair
Copy link
Member

matmair commented Mar 26, 2022

@rkalman ZXing went into maintenance mode so not relying on it would be nice. I took at the other library you suggested and it seems cool - what exactly did not work? Would you like me to take a look?

@rkalman
Copy link
Contributor Author

rkalman commented Mar 27, 2022

I didn't spend too much time with it, but sometimes the camera stream didn't appear even on their demo page.
However it much more capable, but one function is missing: detect whether a camera is present without asking permission from the user.

@matmair
Copy link
Member

matmair commented Apr 28, 2022

@SchrodingersGat we should maybe look at this

@SchrodingersGat
Copy link
Member

@rkalman looks like the camera integration works "out of the box" (at least for me)! Very impressive. Are there any features you still want to integrate, or is this ready for review?

@rkalman
Copy link
Contributor Author

rkalman commented Apr 30, 2022

Please review it, thank you.

@matmair
Copy link
Member

matmair commented Apr 30, 2022

@rkalman nice work!! Thank you

@matmair
Copy link
Member

matmair commented Apr 30, 2022

@SchrodingersGat @rkalman if this merges (I hope so) there needs to be a license addition in the credits section

$('#barcode_scan_video_container').hide();
}

function onBarcodeScanClicked(e) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rkalman you need to export this function in the exported section - so just add
onBarcodeScanClicked
in line 22 of this file

@matmair
Copy link
Member

matmair commented Apr 30, 2022

@rkalman looks good now 👍

@rkalman
Copy link
Contributor Author

rkalman commented Apr 30, 2022

Yes, thank you Mathias, I really had no idea why it is marked as unused...

@matmair
Copy link
Member

matmair commented Apr 30, 2022

@rkalman we missed updating the number of rendered script files. It should really run through now - there are no more tests that should/can fail.

@SchrodingersGat
Copy link
Member

@rkalman thanks for this great addition :) I'm happy to merge this in now.

Can you please add a PR to the documentation which adds:

  • A short note to the 0.7.0 release notes referencing this PR and feature description
  • Update the "frontend libraries" section of the credits page

@SchrodingersGat SchrodingersGat merged commit 6497dd7 into inventree:master Apr 30, 2022
@SchrodingersGat SchrodingersGat added this to the 0.7.0 milestone Apr 30, 2022
@rkalman rkalman deleted the feat-qr-scanner branch May 18, 2022 21:10
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.

None yet

3 participants