dlazaro66 / QRCodeReaderView

Modification of ZXING Barcode Scanner project for easy Android QR-Code detection and AR purposes
1.9k stars 491 forks source link

Can't detect QR code on Amazon Kindle devices #145

Open daentech opened 7 years ago

daentech commented 7 years ago

I'm not sure if this is a known issue, but I'm having some problems detecting a QR code on a kindle tablet.

The QR codes are readable on all other (Google Play) android devices.

I haven't had a chance to investigate thoroughly yet but just want to know if this had a solution I couldn't find. I'll be able to take a proper look over the next couple of days and I can add more to the ticket when I know more.

Would an image of size 480x720 be sufficient to detect?

We're also using the hybrid binarizer and passing in a binary bitmap to the decode method.

Edit: I've investigated a little further:

I'll keep looking to see if I can work out why.

daentech commented 7 years ago

I've investigated this further and it looks like something strange is happening with kindle preview images.

The camera is reporting a preview of size: 720x480 but the image data itself looks to be an image (roughly) of size 715x480. Hardcoding these values on my kindle tablet makes the QR scanner work. I can't find anywhere in the camera or preview where these values would come from, though...

I have attached a couple of screenshots and the raw image data (I guess a byte array, with .txt extension so github will allow it imageData.txt) from the camera just to see if you can think of a reason this data would be the wrong dimensions.

Image at 715x480

screenshot at 715x480

Image at 720x480

screenshot at 720x480