summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlikaid <likaid@codeaurora.org>2015-06-17 15:54:54 +0800
committergfxgitp4 <gfxgitp4@localhost>2015-07-09 05:40:13 -0600
commitc76e210b457442b902cdb3c75e101b75bc6e42c9 (patch)
treee859dfbd612e9f0cb36fc1e8d3144ca9e9f65be7
parent773ad8f90a3e6bf34425f1e355198156f26a0cb5 (diff)
downloadandroid_packages_apps_Snap-c76e210b457442b902cdb3c75e101b75bc6e42c9.tar.gz
android_packages_apps_Snap-c76e210b457442b902cdb3c75e101b75bc6e42c9.tar.bz2
android_packages_apps_Snap-c76e210b457442b902cdb3c75e101b75bc6e42c9.zip
SnapdragonCamera: Add the real image size to media provider db
The image size may change after add the jpeg exif header. If the real file size was not match the _size column in media provider database, the picture will not be opened on PC via MTP mode. Get the real file size after add exif, and save it into provider db. Change-Id: I832d24f4e38e0fd2e2f0fa536bb94927c4ab442a CRS-Fixed: 854308
-rw-r--r--src/com/android/camera/Storage.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/com/android/camera/Storage.java b/src/com/android/camera/Storage.java
index ab2f818ab..372571a80 100644
--- a/src/com/android/camera/Storage.java
+++ b/src/com/android/camera/Storage.java
@@ -117,6 +117,11 @@ public class Storage {
String path = generateFilepath(title, mimeType);
int size = writeFile(path, jpeg, exif, mimeType);
+ // Try to get the real image size after add exif.
+ File f = new File(path);
+ if (f.exists() && f.isFile()) {
+ size = (int) f.length();
+ }
return addImage(resolver, title, date, location, orientation,
size, path, width, height, mimeType);
}