in src/android/CameraLauncher.java [1241:1261]
public void processPicture(Bitmap bitmap, int encodingType) {
ByteArrayOutputStream dataStream = new ByteArrayOutputStream();
CompressFormat compressFormat = getCompressFormatForEncodingType(encodingType);
try {
if (bitmap.compress(compressFormat, mQuality, dataStream)) {
StringBuilder sb = new StringBuilder()
.append("data:")
.append(encodingType == PNG ? PNG_MIME_TYPE : JPEG_MIME_TYPE)
.append(";base64,");
byte[] code = dataStream.toByteArray();
byte[] output = Base64.encode(code, Base64.NO_WRAP);
sb.append(new String(output));
this.callbackContext.success(sb.toString());
output = null;
code = null;
}
} catch (Exception e) {
this.failPicture("Error compressing image: "+e.getLocalizedMessage());
}
}