mobile_scanner icon indicating copy to clipboard operation
mobile_scanner copied to clipboard

Samsung Galaxy A23 wrong scan area

Open p3pp8 opened this issue 1 year ago • 15 comments

  • Mobile scanner 3.2.0
  • Device Samsung Galaxy A23 (tested about 4 device with same result)

It seems that the detection area is located at the upper right screen edge and that it is very small, infact to detect codes i have to put the camera backward enough to reduce the framed code size and move it to the upper right screen edge.

InkedScreenshot_20230422_095609_DropPay Stage

p3pp8 avatar Apr 22 '23 08:04 p3pp8

Just tested using the scanWindow attribute but seems to be ignored.

p3pp8 avatar Apr 22 '23 08:04 p3pp8

Fixed uncommenting this line in MobileScanner.kt inside method start():

analysisBuilder.setTargetResolution(Size(1440, 1920))

I've tried out many resolutions and it always do the job, so i guess, for certain devices, target resolution for analysis builder must always be set.

p3pp8 avatar Apr 24 '23 09:04 p3pp8

This one solves the problem without any aspect ratio issue, no need to set target resolution anymore:

	   val camProfile = CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH)
           analysisBuilder.setDefaultResolution(Size(camProfile.videoFrameWidth, camProfile.videoFrameHeight))

I don't know if this is the right solution but in my case i've tested many devices and everything seems working as aspected.

I've updated many times this comment, i finally discovered that just setting the default resolution solves the issue.

p3pp8 avatar Apr 24 '23 10:04 p3pp8

Did you tested on ios device?

danielleung30 avatar May 03 '23 07:05 danielleung30

@danielleung30 Yes, it works seamlessly. The issue affects only certain Android devices like Galaxy A22 and A23, but i think many others...

p3pp8 avatar May 03 '23 09:05 p3pp8

Thank you bro, you save the day

danielleung30 avatar May 03 '23 09:05 danielleung30

Hello, any news on this? When this issue will be resolved? Having the same symptoms reading QR code on A23.

rpelant avatar Aug 29 '23 15:08 rpelant

I am working on an updated version of #612 which should fix this issue

juliansteenbakker avatar Aug 29 '23 18:08 juliansteenbakker

Any one test version 3.5.1

nirbar89 avatar Oct 29 '23 06:10 nirbar89

Just tested version 3.5.1, nothing to do, the issue is, unfortunately, still there !!!

p3pp8 avatar Oct 30 '23 15:10 p3pp8

Tested on 4.0.0 and the issue is still there

WelliRigo avatar Feb 22 '24 18:02 WelliRigo

Issue is easily resolved setting cameraResolution in MobileScannerController to some reasonable value , for example 1024, 768

rpelant avatar Feb 22 '24 18:02 rpelant

Yes, but... still an issue. Also setting the resolution has other implications

WelliRigo avatar Feb 22 '24 19:02 WelliRigo

Hi, Any update here?

burekas7 avatar Apr 09 '24 15:04 burekas7

The author of this plugin already managed to solve this issue, just set a 4:3 cameraResolution when constructing MobileScannerController.

    final _scannerController = MobileScannerController(
      // 24MPix with an aspect of 4:3 
      cameraResolution: const Size(6080, 8096),
    );

Feel free to set a higher resolution, if not available it will be set using the nearest one.

Hope this will be useful!

p3pp8 avatar Apr 19 '24 10:04 p3pp8