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.

qr code animations

See original GitHub issue

Abstract

I did a proof of concept for scanning animated qrs automatically (without buttons): https://github.com/gorazdko/specter-diy/tree/animiated_qr_video

  • scanner is scanning in continuous mode with the following parameters:
# 100ms
INTERVAL_OF_SCANNING = 0x01
# 0x32 - enable 5 second delay
DELAY_OF_SAME_BARCODES = 128 + 0x32

Animations can be played with https://github.com/gorazdko/specter-desktop/tree/qr_animation

  • def qr_animate(qrtext, max_len=100): max_len determines the maximum chunk size of the frame
  • interval of animating can be set in window.setInterval(function(){full_psbt.qra_next()}, 250)
  • qrs are set for high recovery level (30%): QRCode.CorrectLevel.H

Results

Its feasible, though results arent nearly as good as in https://divan.dev/posts/animatedqr/ where

The best result was 1.4 secs, which is almost 9KB/s! This result has been recorded at a rate of 11 frames per second and chunk size of 850 bytes with Medium recovery level

Here, one setting that works ok is 250 ms interval with 100 byte frames. For optimal settings one should play with parameters

Should we prefer this method over the one with buttons?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
stepansnigirevcommented, Apr 12, 2020

I think we should use animated QR codes only when it is super necessary - rare transactions with many inputs and outputs, very large multisig wallets.

With current PSBT optimizations even a large multisig fits in one QR codes if there are not too many inputs and outputs. And if people want to make a huge transaction, they should be ready to hold their wallet still for quite some time )))

Let’s make it into a pull request. For specter-desktop I suggest to add a checkbox or button animate QR code. So normally QR code is large and shows full data, but if you check the checkbox it becomes smaller and animated.

The same for signed psbt QR code in specter-diy - we have enough space to add a checkbox that would animate the QR code. By default let’s keep it static.

1reaction
gorazdkocommented, Apr 8, 2020

I tried it out, specter-desktop part works great

the qrcode library is not ok. it has a bug: https://github.com/davidshimjs/qrcodejs/issues/220

You will notice it when changing max_len when having QRCode.CorrectLevel.H

I need to look into your code and understand the logic

i will write a couple of sentences later about how this works, the limitations and other things i noticed…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Animated QR codes: how do they work, and how to create ...
The generator enables you to create fully-functional QR codes that look like real pictures as much as possible and even animate them to...
Read more >
Animated QR Code Generator - QR4 - QRCode
This is afree service to generate QR codes in colour with embedded animations online for social media and custom branding QR codes. Upload...
Read more >
Secure QR Code Generator with animations | Animated ...
Bring interactivity to any screen by using one of our animated QR codes to assist your customers to knowledgeably and safely scan your...
Read more >
Animation QR Code by Visualead
Our Animation QR Codes are created in GIF format, for easy integration in your website. They can be created in any pixel size...
Read more >
Animated QR Codes Go Viral, Here's How to Make One
You can quickly create and customize your own animated QR codes with sites like QR4, made by software engineer Jeroen Steeman. Or, try...
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