Vision-Barcode-Scanner icon indicating copy to clipboard operation
Vision-Barcode-Scanner copied to clipboard

selectSizePair method get the first valid preview size

Open NasH5169 opened this issue 6 years ago • 1 comments

Hi here !

Thanks for your work on the Google Sample. It really improves the original project.

https://github.com/wax911/Vision-Barcode-Scanner/blob/master/barcode-reader/app/src/main/java/com/google/android/gms/samples/vision/barcodereader/ui/camera/CameraSource.java#L845

Just one issue about selectSizePair method, you take the first one but:

On Huawei ALE-L21, the first one is the lowest resolution. So the preview is really blur and ugly.

On ZTE B2017G, it's ok, the best resolution is the first one.

For now I chcck the max edge (width or heigh) and take the tallest pair but it is not a really smart algorithm.

I think the best algorithm to develop is to get the closest preview size from the desiredWidth / desiredHeight (e.g. screen size).

Thanks again for your time spend on this.

NasH5169 avatar Jun 19 '18 10:06 NasH5169

Thanks for the heads up, I never had the chance to test with a lot of devices. Amazing observation, I think that would definitely help and will work on a patch for that.

wax911 avatar Jun 19 '18 17:06 wax911