From 7c67f40fc45dce040608e6d96efa654c7b93ce97 Mon Sep 17 00:00:00 2001 From: Fil Maj Date: Wed, 20 Jun 2012 14:38:22 -0700 Subject: [PATCH] Tacked on file extension to camera file --- framework/src/org/apache/cordova/CameraLauncher.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/src/org/apache/cordova/CameraLauncher.java b/framework/src/org/apache/cordova/CameraLauncher.java index d9467fbc..0e86d2c9 100755 --- a/framework/src/org/apache/cordova/CameraLauncher.java +++ b/framework/src/org/apache/cordova/CameraLauncher.java @@ -353,9 +353,10 @@ public class CameraLauncher extends Plugin implements MediaScannerConnectionClie } if (!this.saveToPhotoAlbum) { File tempFile = new File(this.imageUri.toString()); - Uri jailURI = Uri.fromFile(new File("/data/data/" + this.cordova.getActivity().getPackageName() + "/", tempFile.getName())); + Uri jailURI = Uri.fromFile(new File("/data/data/" + this.cordova.getActivity().getPackageName() + "/", tempFile.getName() + "." + (this.encodingType == JPEG ? "jpg" : "png" ))); - // Clean up initial URI before writing out safe URI + // Clean up initial URI before writing out safe URI. + // First try File-based approach to delete. Then use the media delete method. Neither seem to work on ICS right now... boolean didWeDeleteIt = tempFile.delete(); if (!didWeDeleteIt) { int result = this.cordova.getActivity().getContentResolver().delete( @@ -363,7 +364,6 @@ public class CameraLauncher extends Plugin implements MediaScannerConnectionClie MediaStore.Images.Media.DATA + " = ?", new String[] { this.imageUri.toString() } ); - LOG.d("TAG!","result is " + result); } this.imageUri = jailURI; }