Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't read QR code on iOS16 #230

Open
stcanbe opened this issue Sep 22, 2022 · 4 comments
Open

Can't read QR code on iOS16 #230

stcanbe opened this issue Sep 22, 2022 · 4 comments

Comments

@stcanbe
Copy link

stcanbe commented Sep 22, 2022

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?

@sief
Copy link

sief commented Dec 12, 2022

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?

@stcanbe
Copy link
Author

stcanbe commented Dec 20, 2022

@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.

@mp-pallain
Copy link

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.

@luBubble
Copy link

luBubble commented Aug 7, 2023

我是在HTMLImageElement元素发送onload通知后,将HTMLImageElement元素转成imageData进行识别,在ios16中大概率识别失败,猜测是onload时机有问题,所以我做了一个处理,在onload通知发送后,延迟50ms进行imageData获取以及二维码识别,成功解决了这个问题,如果你们的识别逻辑也依赖onload事件,可以试试这个办法

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants