question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Poor Performance in Small `<div>` Containers

See original GitHub issue

Describe the bug Scanning performance seems to be heavily dependent on the size of the <div> containing the video feed. This leads to poor performance when the barcode reader is rendered in a small <div> with a constrained width and/or height.

Is there any way to circumvent this issue, maintaining the performance of the large scanner in a smaller container?

Steps To Reproduce

  1. Print a 1D barcode on paper in multiple sizes (Reference Sheet: barcode_testing.pdf).
  2. Go to Testing CodePen.
  3. Attempt to scan each barcode at various angles.
  4. Check difference in scanning performance by looking at whether qrbox border changes colour.

Expected behavior Both readers should change colour simultaneously (or very close to simultaneously, this can be tested by changing the width of the #reader-1 container to match the container of #reader-2), indicating both have successfully read the barcode at the same time.

Screenshots image

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Firefox
  • Version: 107.0

Additional context

  • Camera: Logitech C920

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mebjascommented, Nov 30, 2022

Ideally the implemented solution handles this “upscaling” process programmatically in JS, rather than CSS, to ensure it works consistently across browsers (Firefox renders the transformed reader differently due to how margin CSS is handled).

Yes this is the plan. I could make it a user configuration (like scandit)

1reaction
mebjascommented, Nov 30, 2022

@maksimstojkovic

Thanks for the pointer! Will implement this technique into the library directly!

Read more comments on GitHub >

github_iconTop Results From Across the Web

A very, very, very big div - Stack Overflow
js GitHub project), I have to deal with potentially a very, very, very big <div> container. I knew there was a risk of...
Read more >
Div block | Webflow University
A Div block is the most basic and versatile element used when building a website. Buttons, Containers, and Sections are all Div blocks...
Read more >
Content Jumping (and How To Avoid It) | CSS-Tricks
But when it does finish, and the results are plopped into the document, it can cause re-layout and push other elements around.
Read more >
CSS Container Queries - CSS: Cascading Style Sheets | MDN
Container queries allow us to look at a container size and apply styles to the contents based on the size of their container...
Read more >
How To Fix Cumulative Layout Shift (CLS) Issues
We want the page to be 0.1 or under to pass this Core Web Vital. ... On design systems, UX, web performance and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found