Friday, February 14, 2014

On some phones android camera vertically placed sideways how to solve


Call system camera code
Intent intent = new Intent (MediaStore.ACTION_IMAGE_CAPTURE);
Uri imageSaveUri = Uri.fromFile (imageFile);

/ / TODO fix g10 bug
intent.putExtra (MediaStore.EXTRA_OUTPUT, imageSaveUri);

activity.startActivityForResult (intent, requestCode);
On some phones bristling camera when the photo is rotated sideways 90 degrees to the left, there is great what God solved this problem, there is a solution it<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
When you use the code to determine the height is greater than the width of the picture, and then rotate the picture processing code.
Reply:
Do it using the rotate animation, rotation is still very simple.
Reply:
The key is that not all phones are like left rotated 90 degrees, so rotate the picture there will be some risk
Reply:
Hardware engineers to help you make that layer from the hardware to help you rotate under the bar, of course, the software can also be achieved here, but it feels better to do on the hardware side,
Reply:
Brother others are doing application development it, where to find what hardware engineers ah! And is part of the phone!
references, 4th Floor reply:
hardware engineers to help you make that layer from the hardware to help you rotate under the bar, of course, the software can also be achieved here, but the feeling better to do in the hardware side,

Reply:
As mentioned above, we are doing application development, it is very difficult to modify the hardware vendors do, oh
Reply:
reference to the third floor of the reply:
key is that not all phones are like left rotated 90 degrees, so rotate the picture there will be some risk


On Android development is to have this risk, the official standard stuff on different devices will have a problem, you want to be 100% compatible, then you have to buy a number of devices to test ah.
Reply:
reference to the 7th floor of replies:
reference to the third floor of replies:

The key is that not all phones are like left rotated 90 degrees, so rotate the picture there will be some risk


On Android development is to have this risk, the official standard stuff on different devices will have a problem, you want to be 100% compatible, then you have to buy a number of devices to test ah.


Our software is downloaded to the user on the market to use, what kind of cell phone users have ah right, this is the problem of user feedback, tricky ah
Reply:
Now test not a cloud test it, just do not know how much money to spend, huh
Reply:
ExifInterface exifInterface = new ExifInterface (s_Path);
int tag = exifInterface.getAttributeInt (ExifInterface.TAG_ORIENTATION, -1);
if (tag == ExifInterface.ORIENTATION_ROTATE_90) {/ / If the image is rotated to rotate the first
}

Use tag to determine whether pre-rotating pictures
Reply:
Photo shot saved direction is fixed, whether you get sideways or vertically to take.
So like the solution is to turn on the camera in the direction of the screen when a fixed (generally transverse)
This will save the photo to see the very image you are shooting has been in the.
Reply:
I used to be solved, because the customer only cool, and millet, which to my solution is simple, when the user is using cool when I turned 90 reading, the other is not rotating, the landlord of this problem only able to determine what type of mobile phone users, making rotation
Reply:
references, 5th Floor reply:
Brother others are doing application development it, where to find what hardware engineers ah! And is part of the phone! 4th Floor cited reply:
Hardware engineers to help you make that layer from the hardware to help you rotate under the bar, of course, the software can also be achieved here, but it feels better to do on the hardware side,

. . Do the whole habit of doing a misunderstanding
Reply:
Use
setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
Programming can be achieved in compulsory cross-screen display
Reply:
reference to the 10th floor of the reply:
ExifInterface exifInterface = new ExifInterface (s_Path);
int tag = exifInterface.getAttributeInt (ExifInterface.TAG_ORIENTATION, -1);
if (tag == ExifInterface.ORIENTATION_ROTATE_90) {/ / If the image is rotated to rotate the first
......


10 F. Thank you, problem solved, thank you for the answer
Reply:
cited 15 floor samblueRed reply:
[Quote = reference to the 10th floor of the reply:]
ExifInterface exifInterface = new ExifInterface (s_Path);
int tag = exifInterface.getAttributeInt (ExifInterface.TAG_ORIENTATION, -1);
if (tag == ExifInterface.ORIENTATION_ROTATE_90) {/ / If the image is rotated to rotate the first
......


Thank you, 10th Floor, problem solved, thank you for your answer
Reply:
Thank you, 10th floor, found a solution.

No comments:

Post a Comment