Any problems with portrait photography when the device is in the landscape?

I am making a rather special camera application for a device that will always physically be stored in landscape orientation. Part of the specification is that it should be able to preview and photograph in portrait orientation - see Image below.

I am having problems excluding "setParameters failed" from the runtime (in response to a call to camera.setParameters() ), and I just wanted to check here if there was any fundamental problem with which, in your opinion, I could collide. For example, it is possible that the light sensors on the back of the camera are located in a rectangle, and physically this cannot be achieved β€” or perhaps some other inevitable problem. (By the way, I was informed that light sensors should be squared, so this problem will not occur, but my sources may be wrong). Maybe it depends on the equipment?

enter image description here

EDIT: FYI my crash log below:

 D/AndroidRuntime(7210): Shutting down VM W/dalvikvm(7210): threadid=1: thread exiting with uncaught exception (group=0x415c2d88) E/AndroidRuntime(7210): FATAL EXCEPTION: main E/AndroidRuntime(7210): Process: com.rai.motion, PID: 7210 E/AndroidRuntime(7210): java.lang.RuntimeException: Unable to resume activity {com.rai.motion/com.rai.motion.MotionMain}: java.lang.RuntimeException: setParameters failed E/AndroidRuntime(7210): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2850) E/AndroidRuntime(7210): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2879) E/AndroidRuntime(7210): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2303) E/AndroidRuntime(7210): at android.app.ActivityThread.access$800(ActivityThread.java:144) E/AndroidRuntime(7210): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1246) E/AndroidRuntime(7210): at android.os.Handler.dispatchMessage(Handler.java:102) E/AndroidRuntime(7210): at android.os.Looper.loop(Looper.java:212) E/AndroidRuntime(7210): at android.app.ActivityThread.main(ActivityThread.java:5151) E/AndroidRuntime(7210): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime(7210): at java.lang.reflect.Method.invoke(Method.java:515) E/AndroidRuntime(7210): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878) E/AndroidRuntime(7210): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694) E/AndroidRuntime(7210): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime(7210): Caused by: java.lang.RuntimeException: setParameters failed E/AndroidRuntime(7210): at android.hardware.Camera.native_setParameters(Native Method) E/AndroidRuntime(7210): at android.hardware.Camera.setParameters(Camera.java:1689) E/AndroidRuntime(7210): at com.rai.motion.MotionMain.change_java_recording_camera_settings(MotionMain.java:2105) E/AndroidRuntime(7210): at com.rai.motion.MotionMain.start_recording_camera(MotionMain.java:2154) E/AndroidRuntime(7210): at com.rai.motion.MotionMain.onResume(MotionMain.java:6013) E/AndroidRuntime(7210): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1192) E/AndroidRuntime(7210): at android.app.Activity.performResume(Activity.java:5310) E/AndroidRuntime(7210): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2840) E/AndroidRuntime(7210): ... 12 more I/Process(7210): Sending signal. PID: 7210 SIG: 9 
+1
source share
1 answer

I made a small camera testing app a while ago. There was no problem to show a camera preview in portrait mode, while the device was in landscape orientation. It was difficult to rotate the camera image at a right angle (because this angle of rotation depends on the device / camera). However, the problem was that the perspective did not match then: the object seemed thicker or stretched. But to find out that the recalculation algorithm should not take a lot of time in Stackoverflow.

So regarding

I just wanted to check here if there was any fundamental problem that you think I could be against.

[...] and physically this cannot be achieved - or perhaps some other inevitable problem.

Answer: this is a doable task. Your exclusion probably has a completely different reason.

+2
source

Source: https://habr.com/ru/post/1201412/


All Articles