- Issue created by @SocialNicheGuru
- πΊπΈUnited States tr Cascadia
QR codes are designed with built-in error correction. This allows part of the QR code to be obscured while still allowing the QR to be scanned and read.
The way logos usually work are they are simply placed on top of the QR code. Yes, this obscures some of the code, but the code and be read if the logo is small enough. QR code error correction levels allow between 7% and 30% of the QR code to be obscured.
You can currently easily do this in the Barcodes module with theming. The barcode--qrcode.html.twig template controls how QR codes are displayed - all you have to do is add an img tag and some CSS to control the size and positioning of your logo img on top of the QR code.
I have some code running locally that lets me increase the default error correction level from the UI - this increases the complexity of the QR code and allows more of it to be obscured. I plan to commit that code eventually, but because overlaying the logo is something easily done with theming I don't have any current plans to put that in unless someone wants to help out with a patch. And I would suggest that a more productive and useful strategy would be to ensure that images generated by this module can use Drupal image filters - that allows modules like image_effects to do things like add overlays without needing any additional code in the Barcodes module. This may be possible already, and may just need documentation.