The problem is the following, I take the photo right and I set it in the activity, so that's fine, but after converting it and sending it to the server and decoding, only only part of the photo appears:
Photo-taking code
private Integer ImageHeight = 520;
private Integer ImageWidth = 520;
// Cria o caminho do arquivo no sdcard
file = SDCardUtils.getPrivateFile(getBaseContext(), simpleDateFormat.format(new Date())+".jpg", Environment.DIRECTORY_PICTURES);
// Chama a intent informando o arquivo para salvar a foto
Intent i = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
i.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
startActivityForResult(i, 0);
Bitmap bitmap = ImageResizeUtils.getResizedImage(Uri.fromFile(file), ImageWidth, ImageHeight, true);
Foto = Utils.ConvertPhotoBase64(bitmap);
Base64 conversion code
public static String ConvertPhotoBase64(Bitmap bmp) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bmp.compress(Bitmap.CompressFormat.PNG, 50, baos);
byte[] data = baos.toByteArray();
Log.i("FOTO64", Base64.encodeToString(data, Base64.DEFAULT));
return Base64.encodeToString(data, Base64.DEFAULT);
}
Thank you.