可以读取相片的方向值,然后旋转 读取方向值请参照下面的代码: ExifInterface exifInterface = new ExifInterface(bitmapUrl); int tag = exifInterface.getAttributeInt(ExifInterface.TAG_ORIENTATION, -1); 然后旋转: int degree = 0; if (orc == ExifInterface.ORIENTATION_ROTATE_90) { degree = 90; } else if (orc == ExifInterface.ORIENTATION_ROTATE_180) { degree = 180; } else if (orc == ExifInterface.ORIENTATION_ROTATE_270) { degree = 270; } if (degrees != 0 && bitmap != null) { Matrix m = new Matrix(); m.setRotate(degrees, (float) bitmap.getWidth() / 2, (float) bitmap.getHeight() / 2); }
读取相册的方向值
最新推荐文章于 2022-10-15 11:54:41 发布