Closed iquirino closed 1 day ago
You inverted the algorithm. It must be:
if (this._options.imageOptions.hideBackgroundDots) {
if (
j >= (count - drawImageSize.hideXDots) / 2 &&
j < (count + drawImageSize.hideXDots) / 2 &&
i >= (count - drawImageSize.hideYDots) / 2 &&
i < (count + drawImageSize.hideYDots) / 2
) {
return false;
}
}
It is working now:
;)
I'm glad to contribute with your project
Hello!
Yes indeed it seems that i
here corresponds to y
axis and j
corresponds to x
(albeit usually it is the opposite way) https://github.com/Loskir/styled-qr-code/blob/e09acc6bcbedbc66a72deb0ed0874d2cc7702540/src/core/QRCanvas.ts#L212-L213
I don't have a deep understanding of this code so I'm not entirely sure what is the best way to fix it. Could you please open an issue or a PR in the upstream repo?
I'd be happy to merge the fix after that and release a new version. Thank you for your contribution!
The issue is on the filter itself, that skips dots to be printed on the QRCode.
if (filter && !filter(i, j)) {
continue;
}
Here's my PR: https://github.com/Loskir/styled-qr-code/pull/3/files
Well I'm not sure it is the right change to do either as it creates a discrepancy between filter(i, j)
and (j: number, i: number): boolean
@Loskir Hello! Were you able to fix that problem with the QR turning over?
I am running my fork in production and everything is working well
I am running my fork in production and everything is working well
You know that I have that problem in production, that the QR is turned around and does not center the logo space properly. How did you solve that in production? Locally I tried the change you recommend but in production that change is lost.
Estoy ejecutando mi bifurcación en producción y todo funciona bien.
How can I install your modifications?
I'm sorry, it worked well, but I am running the Loskir version, because I am using square images at this time.
I'm sorry, it worked well, but I am running the Loskir version, because I am using square images at this time.
I don't understand, it still appears vertical to me when I use a horizontal logo. Would you be kind to tell me what I should do to make it look good? In the local version, modify the code as you had indicated and it worked, but the production version did not.
Just came across this issue myself, the patch @iquirino created does seem to fix the issue. Any chance this will be published in the production package sometime soon?
Thank you and sorry it took so long. Fixed in 1.5.2
Hey, I'm having an issue: