incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject [1/3] android commit: Tacked on file extension to camera file
Date Wed, 20 Jun 2012 21:37:20 GMT
Updated Branches:
  refs/heads/mediascanner de9640be3 -> 2321a3ffe


Tacked on file extension to camera file


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/2321a3ff
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/2321a3ff
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/2321a3ff

Branch: refs/heads/mediascanner
Commit: 2321a3ffe1eb312f71552a5f536f4a468ac661b8
Parents: 8a5ed3b
Author: Fil Maj <maj.fil@gmail.com>
Authored: Wed Jun 20 14:38:22 2012 -0700
Committer: Fil Maj <maj.fil@gmail.com>
Committed: Wed Jun 20 14:38:22 2012 -0700

----------------------------------------------------------------------
 .../src/org/apache/cordova/CameraLauncher.java     |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/2321a3ff/framework/src/org/apache/cordova/CameraLauncher.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CameraLauncher.java b/framework/src/org/apache/cordova/CameraLauncher.java
index c8df6cc..b41d79b 100755
--- a/framework/src/org/apache/cordova/CameraLauncher.java
+++ b/framework/src/org/apache/cordova/CameraLauncher.java
@@ -357,9 +357,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(
@@ -367,7 +368,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;
                         }


Mime
View raw message