-
Notifications
You must be signed in to change notification settings - Fork 9.7k
FIx issue with calculating iOS image orientation in certain special c… #1135
FIx issue with calculating iOS image orientation in certain special c… #1135
Conversation
…ases (#26786) Uses accelerometer data to determine device orientation when the photo is taken. Fixes flutter/flutter#26786 . flutter/flutter#26786
|
One known issue with the current solution: You may notice that if you shake the device up/down in portrait or left/right in landscape that the orientation sometimes comes out wrong. I think this approach might be more robust against unusual amounts of acceleration, e.g. the user is in a bumpy car ride, if one were to take an average/smoothing of the accelerometer metrics over the past few seconds, but that requires a bit more work to implement, so just starting with this to see what you think. |
|
Haven't written it in objective-c, but using the sensors library in dart, averaging over 200 milliseconds seemed to do pretty well at preventing jittery movements from affecting the outcome, although I did not test in an actual bumpy car. |
mklim
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again for investigating this and submitting a PR! I tested it out with front and rear cameras. It doesn't have any regressions and fixes the edge case that's currently broken now. This code LGTM pending a review from @cyanglaz to verify the objective c style.
cyanglaz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A tiny nit otherwise LGTM.
flutter#1135) Uses accelerometer data to determine device orientation when the photo is taken. Fixes flutter/flutter#26786 . flutter/flutter#26786
…pecial c… (flutter#1135)" This reverts commit 007389b.
flutter#1135) Uses accelerometer data to determine device orientation when the photo is taken. Fixes flutter/flutter#26786 . flutter/flutter#26786
flutter#1135) Uses accelerometer data to determine device orientation when the photo is taken. Fixes flutter/flutter#26786 . flutter/flutter#26786
flutter#1135) Uses accelerometer data to determine device orientation when the photo is taken. Fixes flutter/flutter#26786 . flutter/flutter#26786

…ases (#26786)
Uses accelerometer data to determine device orientation when the photo is taken. Fixes flutter/flutter#26786 .