You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/05/06 13:11:18 UTC

[GitHub] [cordova-plugin-camera] janpio commented on a change in pull request #432: GH-420 (all) DATA_URL is improperly prefixed

janpio commented on a change in pull request #432: GH-420 (all) DATA_URL is improperly prefixed
URL: https://github.com/apache/cordova-plugin-camera/pull/432#discussion_r281177799
 
 

 ##########
 File path: src/android/CameraLauncher.java
 ##########
 @@ -1261,14 +1261,23 @@ public void processPicture(Bitmap bitmap, int encodingType) {
         CompressFormat compressFormat = encodingType == JPEG ?
                 CompressFormat.JPEG :
                 CompressFormat.PNG;
+        String imageMimeType = encodingType == JPEG ?
+                JPEG_MIME_TYPE :
+                PNG_MIME_TYPE;
 
         try {
             if (bitmap.compress(compressFormat, mQuality, jpeg_data)) {
                 byte[] code = jpeg_data.toByteArray();
                 byte[] output = Base64.encode(code, Base64.NO_WRAP);
                 String js_out = new String(output);
-                this.callbackContext.success(js_out);
+                String base64Prefix = "data:" + imageMimeType + ";base64,";
 
 Review comment:
   This comment should probably be in the line below, 1274 - because the line you commented on actually is _not_ snake case.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org