I am using a camera intent to take pictures, then I convert that image to a bytearray and eventually save it locally in my database. The original image taken with the camera has all the metadata like GPS latitude and longtitude etc. However, the bitmap I create from that image does not include any meta data. How can I add the original metedata to my image ?
Here is my code where the camera intent returns:
picUri = data.getData()
Bitmap yourSelectedImage62 = null;
String imagebytes2 ;
try
{
yourSelectedImage62 = MediaStore.Images.Media.getBitmap(this.getContentResolver(), picUri);
yourSelectedImage62 = Bitmap.createScaledBitmap(yourSelectedImage62, large_width, large_height, true);
} catch (FileNotFoundException ex)
{
Logger.getLogger(Screen_View_Submission.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(Screen_New_Submission.class.getName()).log(Level.SEVERE, null, ex);
}
ByteArrayOutputStream bao62 = new ByteArrayOutputStream();
yourSelectedImage62.compress(Bitmap.CompressFormat.JPEG, 75, bao62);
byte[] ba62 = bao62.toByteArray();
imagebytes2 = Base64.encodeToString(ba62,Base64.DEFAULT);
yourSelectedImage62.recycle();