Android development mobile phone (Samsung) photography application photo rotation problem solution

Android development mobile phone (Samsung) photography application photo rotation problem solution

Recently, I have solved a problem that has bothered me for a long time, that is, the rotation of pictures taken by Samsung mobile phones. The project has the function of uploading pictures. When it comes to taking pictures and selecting pictures from photo albums, other mobile phones are OK. Only after Samsung mobile phones take pictures, you will clearly see that you will rotate the photos, Then the picture you found according to the path has been rotated, and the solution has finally been found by me. We can read the rotation angle in the photo EXIF (exchangeable image file) information according to the path of the picture

According to the debugging, it can be clearly found that the rotation angle of the pictures taken by Samsung mobile phones is 90 degrees, while the rotation angle of other mobile phones is 0 degrees

Look at the code:

Then we just need to rotate the picture according to the rotation angle

Thank you for reading, hope to help you, thank you for your support to this site!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>