Skip to content

Margin parameter not respected & QR code is different based on URL length #210

@swissarthurfreeman

Description

@swissarthurfreeman

Dear All,

I'm encountering two issues which I suspect are related : the margin parameter seems to not be respected and the length of the URL to encode
changes the specified image margin.

As far as I understand, the margin is the number of pixels between the QR code and the image frame,
highlighted in red in the picture below :

Image

With the default configuration, it would seem there is no apparent difference in the preview pane when entering a value from 1-13 in
the margin box,

Image

however as soon as you switch to 14, then the margin grows,

Image

and it's the same thing until 28, where finally the margin grows,

Image

So the margin parameter only seems to work for predefined values. Additionally, if we change the encoded URL length, depending on the length the frame disappears completely,

Image

or comes back erratically,

Image

I'm aware this must have to do with the QR code generation logic. The data has to fit somehow and if we have a fixed width and height in pixels image output, it might not be possible to avoid eating up the margins.

This behaviour is however a little awkward, I'd be glad to have an option to set a fixed margin that gets respected with a flexible image size. This avoids having to deal with changing margins in subsequent applications. (In my case, mass writing QR codes encoding different URL lengths expecting a fixed margin to PDFs using tools like reportlab : having different size margins requires additional logic).

This isn't really a bug report as much as a suggestion for improvement, given the time I'd be happy to make a pull request, but I'd need the community to agree on these two points :

  1. How should the margin parameter work ?
  2. Would it make sense to have a fixed margin variable image size option ?

Best regards,

In any case, this is a nitpick, the tool itself is the best open source there is,

Best regards,

Arthur Freeman

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions