我有一个旋转图像的方法,但我总是收到一个OutMemoryError,但我在相册中的图像是从相机拍摄的,尺寸宽度是5000~手机
我将照片调整为宽度1280和高度960
我的第一个显示和调整图像的方法是
public static Boolean ShowImagesCapture(Context context, Uri PATH_IMAGE, ImageCropView view,int width, int height){
int orientation=0;
Boolean success = true;
try {
Bitmap bitmap =null;
if (Build.VERSION.SDK_INT < 19) {
String selectedImagePath = getPath(PATH_IMAGE,context);
bitmap = BitmapFactory.decodeFile(selectedImagePath);
orientation=GetPhotoOrientation(context,getRealPathFromURI(context,PATH_IMAGE));
}
else {
ParcelFileDescriptor parcelFileDescriptor;
try {
parcelFileDescriptor = context.getContentResolver().openFileDescriptor(PATH_IMAGE, "r");
FileDescriptor fileDescriptor = parcelFileDescriptor.getFileDescriptor();
bitmap = BitmapFactory.decodeFileDescriptor(fileDescriptor);
parcelFileDescriptor.close();
orientation=GetPhotoOrientation(context,getRealPathFromURI(context,PATH_IMAGE));
} catch (Exception e) {
e.printStackTrace();
}
}
switch (orientation) {
case ExifInterface.ORIENTATION_ROTATE_180:
bitmap=rotateBitmap(bitmap,3,width,height);
view.setImageBitmap(bitmap);
break;
break;
case ExifInterface.ORIENTATION_ROTATE_90:
bitmap=rotateBitmap(bitmap,8,width,height);
view.setImageBitmap(bitmap); …Run Code Online (Sandbox Code Playgroud) 我正在Ruby on Rails中的Base64中工作,并且有一个问题:
例如,如何对Base64进行以下编码/解码?
<a href="myroute?id=<%=@client.id%>"> MY LINK</a>
Run Code Online (Sandbox Code Playgroud)