Skip to content

Commit

Permalink
fix(android): add missing format field in CameraPhoto (#1798)
Browse files Browse the repository at this point in the history
  • Loading branch information
WIStudent authored and jcesarmobile committed Jul 24, 2019
1 parent f595a00 commit c61d4cb
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ private void returnFileURI(PluginCall call, ExifWrapper exif, Bitmap bitmap, Uri
bis = new ByteArrayInputStream(bitmapOutputStream.toByteArray());
Uri newUri = saveTemporaryImage(bitmap, u, bis);
JSObject ret = new JSObject();
ret.put("format", "jpeg");
ret.put("exif", exif.toJson());
ret.put("path", newUri.toString());
ret.put("webPath", FileUtils.getPortablePath(getContext(), bridge.getLocalUrl(), newUri));
Expand Down Expand Up @@ -409,6 +410,7 @@ private void returnDataUrl(PluginCall call, ExifWrapper exif, ByteArrayOutputStr
String encoded = Base64.encodeToString(byteArray, Base64.NO_WRAP);

JSObject data = new JSObject();
data.put("format", "jpeg");
data.put("dataUrl", "data:image/jpeg;base64," + encoded);
data.put("exif", exif.toJson());
call.resolve(data);
Expand All @@ -419,6 +421,7 @@ private void returnBase64(PluginCall call, ExifWrapper exif, ByteArrayOutputStre
String encoded = Base64.encodeToString(byteArray, Base64.NO_WRAP);

JSObject data = new JSObject();
data.put("format", "jpeg");
data.put("base64String", encoded);
data.put("exif", exif.toJson());
call.resolve(data);
Expand Down

0 comments on commit c61d4cb

Please sign in to comment.