openfoodfacts / smooth-app

🤳🥫 The new Open Food Facts mobile application for Android and iOS, crafted with Flutter and Dart
https://world.openfoodfacts.org/open-food-facts-mobile-app?utm_source=off&utf_medium=web&utm_campaign=github-repo
Apache License 2.0
853 stars 282 forks source link

Focus point is still in center #1898

Closed M123-dev closed 2 years ago

M123-dev commented 2 years ago

What

https://user-images.githubusercontent.com/39344769/169345163-bff8f0cb-2df7-44ad-ad34-9717b66df642.mp4

g123k commented 2 years ago

Just to be sure, @M123-dev could you run the example project from the camera library? https://github.com/flutter/plugins/tree/master/packages/camera/camera

And are the results better than in Smoothie? The code seems to be the same, but we never know

g123k commented 2 years ago

Any news @M123-dev?

stephanegigandet commented 2 years ago

@g123k I have the same issue on my Galaxy S8:

https://user-images.githubusercontent.com/8158668/172144672-9cfb9489-e731-4278-8423-460098341b24.mp4

g123k commented 2 years ago

Hi Marvin,

I would need your help on this. Could you please try to change the focus point in the code and tell me which value is OK? (I tend to think that some devices have "rotated" cameras, which may explain why the focus is not at the correct coordinates)

In ml_kit_scan_page line 416

g123k commented 2 years ago

I am able to reproduce this issue on a Samsung device. Basically, all calls to setFocus… are ignored. It seems this is a native issue

monsieurtanuki commented 2 years ago

A suggestion: what if we restricted the camera widget to the top half of the screen? Of course that would mean no camera display on the bottom half (less nice), but the focus should be on [.5, .25] then, right?

g123k commented 2 years ago

It won't fix this issue actually, because the root cause is that setFocusPoint is just ignored.

monsieurtanuki commented 2 years ago

Oh we don't need setFocusPoint anymore: if the focus is on the camera center, we're good anyway.

g123k commented 2 years ago

I've found the issue on the native part (which I think is a better fix). Could you try again @M123-dev / @stephanegigandet

(It's on my fork of the camera plugin, so you have nothing to do, expect a flutter upgrade)

M123-dev commented 2 years ago

Sadly it doesn't seem to be solved @g123k it looks like the camera doesn't focus on close objects anymore. (Updated my dependencies) Also found another bug of the camera not resuming

https://user-images.githubusercontent.com/39344769/172471082-fb4e282b-dc9d-48a2-babe-ca884a1d0aae.mp4

VaiTon commented 2 years ago

@g123k should this be closed after the lastest camera update?

M123-dev commented 2 years ago

Works like charm (at least on my device)