Can't read QR code on iOS16
stcanbe opened this issue · 4 comments
I am unable to read QR codes on iOS16.
const code = jsQR(imageData, width, height);
Each argument is set correctly, but the result is null. There is no error message.
I was able to read QR codes until iOS15.
Could anyone help me solve this problem?
Same problem here. I doubt this has anything to do with this library. Looks to me like the autofocus is not working properly. I found several hints that this might be related to the iPhone's auto-macro option.:
https://developer.apple.com/forums/thread/715568
https://www.iphonetricks.org/camera-not-focusing-ios-16-issue-fix/
https://www.phoneswiki.com/ios-16-camera-app-issues/
The fix described here didn't solve the problem for me, I guess this only works for the native camera app.
I also tried to set MediaTrackSettings.zoom, but apparently that's not supported by Safari/iOS.
@stcanbe have you tried to scan with the selfie camera on iOS 16?
@sief
Thank you for your comment.
I can read the QR code with my camera, but cannot read the QR code image from the album.
I don't know if that has anything to do with the autofocus issue.
This is also an issue for me... I am converting a pdf to a png and then getting my imagedata, width and height. it is working in 90%+ of cases but sometimes i am getting null.. I am able to use my phone to get the data from the qr code.. would be great if anybody has in suggestions. currently when i get this null value i have it set up to create a ticket and from there i manually intervene.
我是在HTMLImageElement元素发送onload通知后,将HTMLImageElement元素转成imageData进行识别,在ios16中大概率识别失败,猜测是onload时机有问题,所以我做了一个处理,在onload通知发送后,延迟50ms进行imageData获取以及二维码识别,成功解决了这个问题,如果你们的识别逻辑也依赖onload事件,可以试试这个办法