Apparence-io / CamerAwesome

📸 Embedding a camera experience within your own app shouldn't be that hard. A flutter plugin to integrate awesome Android / iOS camera experience.
https://ApparenceKit.dev
MIT License
976 stars 256 forks source link

"Fake" zoom #27

Closed W34therwax closed 4 years ago

W34therwax commented 4 years ago

Thanks for that amazing lib! I am struggling though with taking zoomed picture. Shouldn't it be covered in lib? If not, maybe you have solved that issue internally and can provide some snippet? :)

It was tested on Xiaomi Mi 9 and Samsung S9+

Cheers

Steps to Reproduce

use zoom in camera

Expected results

image taken of visible zoomed in area

Actual results

whole picture, as it was on zoomNotifier = 0

g-apparence commented 4 years ago

Hi, Thanks you reporting this issue. 😄 will look into it. I think it's a new bug coming from a recent change (focus handling). Flutter e2e tests are not enough to detect it.

g-apparence commented 4 years ago

Fixed

W34therwax commented 4 years ago

@g-apparence hey, thanks for fixing zoom issue, only I am quite sure this introduced new bug related to front-back camera switch.

Its on Xiaomi Mi 9, Android 10

I have run your example project from 0.1.0 and camera switch works, but example project 0.1.1 version, camera switch make app close with fatal error

D/com.apparence.camerawesome.CamerawesomePlugin( 4290): _handleSwitchSensor: FRONT => FRONT D/StreamConfigurationMap( 4290): setFlag Flag:0 W/awesome_example( 4290): type=1400 audit(0.0:28452): avc: denied { read } for name="u:object_r:persist_camera_prop:s0" dev="tmpfs" ino=21975 scontext=u:r:untrusted_app:s0:c87,c257,c512,c768 tcontext=u:object_r:persist_camera_prop:s0 tclass=file permissive=0 E/libc ( 4290): Access denied finding property "persist.vendor.camera.privapp.list" D/com.apparence.camerawesome.CameraStateManager( 4290): switchCamera: finished D/AndroidRuntime( 4290): Shutting down VM E/AndroidRuntime( 4290): FATAL EXCEPTION: main E/AndroidRuntime( 4290): Process: com.apparence.camerawesome_example, PID: 4290 E/AndroidRuntime( 4290): java.lang.IllegalStateException: Reply already submitted E/AndroidRuntime( 4290): at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:139) E/AndroidRuntime( 4290): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:238) E/AndroidRuntime( 4290): at com.apparence.camerawesome.CamerawesomePlugin$1.onOpened(CamerawesomePlugin.java:341) E/AndroidRuntime( 4290): at com.apparence.camerawesome.CameraStateManager.onOpened(CameraStateManager.java:135) E/AndroidRuntime( 4290): at android.hardware.camera2.impl.CameraDeviceImpl$1.run(CameraDeviceImpl.java:151) E/AndroidRuntime( 4290): at android.os.Handler.handleCallback(Handler.java:883) E/AndroidRuntime( 4290): at android.os.Handler.dispatchMessage(Handler.java:100) E/AndroidRuntime( 4290): at android.os.Looper.loop(Looper.java:224) E/AndroidRuntime( 4290): at android.app.ActivityThread.main(ActivityThread.java:7551) E/AndroidRuntime( 4290): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime( 4290): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539) E/AndroidRuntime( 4290): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950) Lost connection to device. Exited (sigterm)

g-apparence commented 4 years ago

Noted, will look into it. We've improved stability across rebuilds, it's more the error source. Anyway should have seen it before, thanks for reporting.

W34therwax commented 4 years ago

@g-apparence do you think you will have time looking into it this or next week?

g-apparence commented 4 years ago

Will try to fix this asap. Will be done by the end of the week. :)

g-apparence commented 4 years ago

Was just one line that I forgot. Fixed this. Sorry for this, and thank you reporting it 👍