Vision-Barcode-Scanner
Vision-Barcode-Scanner copied to clipboard
selectSizePair method get the first valid preview size
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.
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.