lyqht / mini-qr

Mini accessible web app to generate customized qr codes easily 👾
https://mini-qr-code-generator.vercel.app
GNU General Public License v3.0
449 stars 60 forks source link

QR Code Shrinks in Size When Generating from Full vCard #44

Closed addoodi closed 1 week ago

addoodi commented 1 month ago

Description:

I've encountered an issue where the generated QR code becomes significantly compressed when using a full vCard with all details. The QR code appears in the center of the image with large borders, making it difficult to scan. However, if I remove any of the long lines, the QR code snaps back to its expected size, filling the image area correctly.

Steps to Reproduce:

Create a Docker container to generate a QR code for the following vCard: BEGIN:VCARD VERSION:3.0 FN:John Doe N:Doe;John;;; ORG:Company Name TITLE:Job Title TEL;TYPE=CELL:+1234567890 TEL;TYPE=WORK:+0987654321 EMAIL;TYPE=WORK:john.doe@company.com EMAIL;TYPE=HOME:john.doe@example.com ADR;TYPE=WORK:;;123 Main St;City;State;Postal Code;Country URL;TYPE=WORK:https://www.companywebsite.com SOCIALPROFILE;type=twitter:https://twitter.com/username SOCIALPROFILE;type=linkedin:https://www.linkedin.com/in/username SOCIALPROFILE;type=instagram:https://www.instagram.com/username END:VCARD Observe the generated QR code, which appears compressed in the center with large borders.

Remove any line below TITLE:Job Title (the long ones except END:VCARD), regenerate the QR code, and notice that it fills the image correctly. Screenshots:

Full vCard (Issue Present): qr-code (3)

Slightly reduced vCard (Working Fine): qr-code (5)

Environment: Docker container

lyqht commented 1 month ago

hello there, thanks for this issue. I didn't know about the vCard format before, and also wasn't aware about the case where the qr code size changes as the data increases in length.

I've added a new feature for error correction levels, where i also gave a recommended level based on your current data length. For the test case you given, setting either L/M error correction level helps to set the qr code size better. You can read a little more in the PR & the new "What is this?" button for why the data length affects the QR code.

Please let me know if this feature addresses this issue sufficiently :D

lyqht commented 1 week ago

assuming it works, closing the issue. let me know if you need more help.