kozakdenys / qr-code-styling

Automaticly generate your styled QR code in your web app.
https://qr-code-styling.com
MIT License
1.56k stars 498 forks source link

QR code size inconsistency #255

Closed felipedrumond closed 1 month ago

felipedrumond commented 1 month ago

I created two qr codes with very similar data (url) with the same configuration.

      width: 95,
      height: 95,
      margin: 3,
      data: url,
      image: 'favicon.ico',
      dotsOptions: {
        color: '#000',
        type: 'rounded',
      },
      backgroundOptions: {
        color: '#D9D9D9',
      },
      imageOptions: {
        crossOrigin: 'anonymous',
        margin: 5,
        imageSize: 0.6,
      },
    });

    qrCode.append(this.canvas.nativeElement);

When the url is 'http://localhost:4200/guide-cover/47/leave-hubby-on-the-couch-solo-in-barcelona', I get this qr code: image

When the url is 'http://localhost:4200/guide/1/a', the qr has the correct size set in the configuration: image

Is there a way to tell the qr code to always be the specified size?

kozakdenys commented 1 month ago

@felipedrumond hi, try to use 'dotsOptions.roundSize = false'

felipedrumond commented 1 month ago

That worked, thank you!