summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/ImageManager.java
diff options
context:
space:
mode:
authorRay Chen <raychen@google.com>2009-09-27 15:39:55 -0700
committerRay Chen <raychen@google.com>2009-09-27 15:48:25 -0700
commitd02b313115e8f4c92a377955af62478765146fb1 (patch)
treeab1f9502769a3e7a939c11d44310212efe8e8ee5 /src/com/android/camera/ImageManager.java
parent7e4655b1b3fcbc543430bea680872f564af098f5 (diff)
downloadLegacyCamera-d02b313115e8f4c92a377955af62478765146fb1.zip
LegacyCamera-d02b313115e8f4c92a377955af62478765146fb1.tar.gz
LegacyCamera-d02b313115e8f4c92a377955af62478765146fb1.tar.bz2
Fix the camera directory path issue.
Diffstat (limited to 'src/com/android/camera/ImageManager.java')
-rw-r--r--src/com/android/camera/ImageManager.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/com/android/camera/ImageManager.java b/src/com/android/camera/ImageManager.java
index f4a5e6f..2bce37d 100644
--- a/src/com/android/camera/ImageManager.java
+++ b/src/com/android/camera/ImageManager.java
@@ -231,9 +231,11 @@ public class ImageManager {
// We should store image data earlier than insert it to ContentProvider, otherwise
// we may not be able to generate thumbnail in time.
OutputStream outputStream = null;
- File file = new File(directory, filename);
+ String filePath = directory + "/" + filename;
try {
- file.mkdirs();
+ File dir = new File(directory);
+ if (!dir.exists()) dir.mkdirs();
+ File file = new File(directory, filename);
outputStream = new FileOutputStream(file);
if (source != null) {
source.compress(CompressFormat.JPEG, 75, outputStream);
@@ -260,7 +262,7 @@ public class ImageManager {
values.put(Images.Media.DATE_TAKEN, dateTaken);
values.put(Images.Media.MIME_TYPE, "image/jpeg");
values.put(Images.Media.ORIENTATION, orientation);
- values.put(Images.Media.DATA, directory + "/" + filename);
+ values.put(Images.Media.DATA, filePath);
if (location != null) {
values.put(Images.Media.LATITUDE, location.getLatitude());