kozakdenys / qr-code-styling

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

something is wrong in this library. #49

Open justraman opened 3 years ago

justraman commented 3 years ago

this lib is dependent on https://kazuhikoarase.github.io/qrcode-generator/js/demo/.

when I create a QR there it's scannable from all devices and all QR apps.

but when I create the same QR from https://qr-code-styling.com/ without(image and styling) it's not scannable from less popular QR apps.

how this is possible?

reference app for android: https://play.google.com/store/apps/details/?id=com.mrakash.qrcodescanner ios: Facebook app, QR scanner Pro

randomprogramming commented 3 years ago

Don't think it's this library, I've had the same issues using pretty much any QR Code styling library. As soon as you change the styling of a QR code even the slightest a lot of web and android based qr code scanners just don't want to scan the code.

Interestingly, iOS never has any issues from my testing.

DewiarQR commented 3 years ago

Столкнулся с той же проблемой. Даже самый простой, совсем не измененный QR код в этой библиотеке - не сканируется. При этом в библиотеке https://kazuhikoarase.github.io/qrcode-generator/js/demo/ он сканируется очень хорошо.

В БИБЛИОТЕКЕ ЕСТЬ КРИТИЧЕСКАЯ ОШИБКА! Если ее не исправить, примерно половина распространенных сканеров не смогут расшифровать эти QR-коды. Ошибка в том, что пиксели-точки развернуты не верно, они отображены зеркально и повернуты на 90 градусов, это не правильно.

Screenshot_2

DewiarQR commented 3 years ago

На изображении сверху 2 QR кода с одной и той же зашифрованной информацией. Слева, корректный и правильный QR-код, считывающийся всеми сканерами. Справа - QR-Code styling - с ошибкой размещения точек (окрашены бордовым цветом). Видно, что они развернуты не верно. Я пытался в библиотеку внести правку, перед отображением этот контейнер отображаю зеркально и сдвигаю на 180 градусов, это частично решает проблему. Но проблема всеравно дает о себе знать при загрузке фото в центр, фотография также переворачивается зеркально.

dmitrystas commented 2 years ago

https://github.com/kozakdenys/qr-code-styling/pull/110

HenkVanMaanen commented 2 years ago

@dmitrystas this can be fixed too by the following code, it needs to be fixed in both QRSVG.ts and QRCanvas.ts:

WRONG: dot.draw( xBeginning + i * dotSize, yBeginning + j * dotSize,

FIX: dot.draw( yBeginning + j * dotSize, xBeginning + i * dotSize,

HenkVanMaanen commented 2 years ago

See fix here: https://github.com/sallandpioneers/qr-code-styling

This fork will be maintained until further notice by Salland Pioneers (business).