Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera is flipped 90 degrees #5

Open
diegurrio opened this issue Jun 13, 2013 · 2 comments
Open

Camera is flipped 90 degrees #5

diegurrio opened this issue Jun 13, 2013 · 2 comments

Comments

@diegurrio
Copy link

Hi I'm trying the demo in a tablet device. When the activity starts the camera is flipped 90 degrees. The layout seems fine.

@simon-heinen
Copy link
Owner

tablets have the axis switched, I think you can modify the camera preview to work also on tablets. see also http://stackoverflow.com/questions/3852154/android-camera-unexplainable-rotation-on-capture-for-some-devices-not-in-exif

@rvieras
Copy link

rvieras commented Oct 31, 2013

I am having this same issue. I have adjusted the preview to rotate 90 degrees however when running demos the augmented object do not currently appear. For example when looking at he "Placing objects Demo 2" the augmented object does not appear to move. The way i changed to 90 degrees preview was I added a check in "setPreviewAccordingToScreenOrientation" to check if the device is a tablet.

if(!EventManager.isTabletDevice){
if (rotation == Surface.ROTATION_0) {
parameters.setPreviewSize(height, width);
setDisplayOrientation(90);
} else if (rotation == Surface.ROTATION_90) {
parameters.setPreviewSize(width, height);
setDisplayOrientation(0);
} else if (rotation == Surface.ROTATION_180) {
parameters.setPreviewSize(height, width);
setDisplayOrientation(0);
} else if (rotation == Surface.ROTATION_270) {
parameters.setPreviewSize(width, height);
setDisplayOrientation(180);
}
}else{
//TODO:
if(rotation == Surface.ROTATION_0){
Log.e("ROTATION", "ITS A TABLET SETING ROTATION from " + rotation + " to something");
parameters.setPreviewSize(height, width);
setDisplayOrientation(-90);
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants