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

Whitespace is added to generated QR code image (PngByteQRCode) #312

Closed
ctorx opened this issue Jul 7, 2021 · 1 comment · Fixed by #350
Closed

Whitespace is added to generated QR code image (PngByteQRCode) #312

ctorx opened this issue Jul 7, 2021 · 1 comment · Fixed by #350

Comments

@ctorx
Copy link

ctorx commented Jul 7, 2021

Type of issue

[ ] Bug
[ ] Question (e.g. about handling/usage)
[X ] Request for new feature/improvement

Expected Behavior

When using the PngByteQRCode.GetGraphic() the resulting image should have no whitespace around the QR code.

Current Behavior

Whitespace is added around the qrcode in the resulting image.

Possible Solution (optional)

There should be either (1) the option to disable whitespace around the QR code or (2) the ability to specify the amount of whitespace that would include the option for 0.

Your Environment

  • Version used: 1.4.1
  • Compiled from source or NuGet package?: Nuget
  • Payload/Encoded text: 999020228
  • Used payload generator: QRCodeGenerator
  • Used ECC-level: Q
  • Used renderer class: PngByteQRCode
  • Environment (.NET 3.5, .NET 4.X, .NETCore, ...): netcore 3.1
@codebude
Copy link
Owner

Hello @ctorx ,
first of all - the "whitespace" around the QR code is not a peculiarity of the QR coder, but a requirement of the official QR code standard. In the standard this whitespace is called "quiet zone". It is intended to ensure that the QR Code can be recognized by reading devices in the best possible way.

Nevertheless, I understand your requirement and this is not the first time I've heard it. (Because the QR Codes can remain readable even without the quiet zones or the developer can also take care of a sufficient quiet zone himself when embedding the QR Code).
For this reason I added a new, additional and optional parameter "drawQuietZone" (type: bool). If you set this parameter to "false", the quiet zone will not be rendered. You can find hints on how to use it in the wiki.

The parameter is available now in the CI-build or with the release of the official version 1.4.2 on Nuget. (Official release will follow soon...)

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

Successfully merging a pull request may close this issue.

2 participants