My user app can use the camera to take a photo and need to save it in the database. To save to the database I convert the image to an array of bytes, however I noticed a problem in this process when the camera resolution is high (4: 3 16 MB) does not work and when I get smaller as 16: 9 (6 MB ) it works. I'm using ORMLite to save and it does not return any error exception when the camera is in high resolution, does anyone know what it can be?
Bitmap photo = null;
File file = new File(mCurrentPhotoPath);
photo = MediaStore.Images.Media.getBitmap(
this.getActivity().getContentResolver(),Uri.fromFile(file));
ByteArrayOutputStream stream = new ByteArrayOutputStream();
photo.compress(Bitmap.CompressFormat.JPEG, 100, stream);
bytesImage = stream.toByteArray();
CheckListPendente CheckListPendente2 = new CheckListPendente();
CheckListPendente2.setId(checkListPendenteId);
CheckListResposta resposta = new CheckListResposta();
if (bytesImage != null) {
resposta.setImageBytes(bytesImage);
}
checkListDao = CheckListRespostaDao(helper.getConnectionSource());
checkListDao.create(resposta);