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

fix: add logo support to QR code API using <img> tag as a workaround #1321

Merged
merged 8 commits into from
Oct 4, 2024

Conversation

BharathxD
Copy link
Contributor

@BharathxD BharathxD commented Oct 4, 2024

Add logo support to QR code API using <img> tag workaround

qr-14

Summary

This PR adds logo support to the QR code API by using an <img> tag as a workaround, which fixes the issue #1301

Changes

  • Implemented logo support by embedding the logo image using an <img> tag instead of an SVG <image> element. This serves as a workaround for the rendering issue described in vercel/satori#592.
  • Fixed QR code breakage due to excavation by defaulting the error correction level to 'Q' or 'H' when excavation is provided. This ensures the QR code remains scannable despite the modules removed for the logo placement.

Motivation

  • The <img> tag workaround bypasses the rendering issues with the SVG <image> tag in the current environment.
  • Defaulting to a higher error correction level ('Q' or 'H') when excavation is used maintains the integrity and scannability of the QR code.

Testing

  • Generated QR codes with logos to confirm that they render correctly and are scannable.
  • Verified that when excavation is provided, the error correction level defaults appropriately.

References

Copy link

vercel bot commented Oct 4, 2024

@BharathxD is attempting to deploy a commit to the Dub Team on Vercel.

A member of the Team first needs to authorize it.

@BharathxD
Copy link
Contributor Author

BharathxD commented Oct 4, 2024

WIP: This could break the other QR Code Components

Copy link

vercel bot commented Oct 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
dub ✅ Ready (Inspect) Visit Preview Oct 4, 2024 5:32pm

Copy link

socket-security bot commented Oct 4, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@vercel/og@0.6.3 environment, filesystem, network +21 16.8 MB vercel-release-bot

🚮 Removed packages: npm/@vercel/og@0.6.2

View full report↗︎

@steven-tey steven-tey changed the base branch from fix-qr to main October 4, 2024 18:25
@steven-tey
Copy link
Collaborator

@BharathxD you sir are a wizard
your-a-wizard-harry

@steven-tey steven-tey merged commit b8140b7 into dubinc:main Oct 4, 2024
4 of 5 checks passed
Copy link

oss-gg bot commented Oct 4, 2024

Awarding BharathxD: 750 points 🕹️ Well done! Check out your new contribution on oss.gg/BharathxD

@BharathxD
Copy link
Contributor Author

@BharathxD you sir are a wizard
your-a-wizard-harry

Glad to Help! 😂🙌🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants