diff options
author | likaid <likaid@codeaurora.org> | 2015-06-17 15:54:54 +0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2015-06-22 22:56:05 -0700 |
commit | 0af30e77da5ca7995f185879c701004ca6a0dc1a (patch) | |
tree | 04e22f3e8709533e784124a3258162cf8c3ff83a | |
parent | 9a0d0cbc63632d50c03bbd18597a3b8db1d83303 (diff) | |
download | android_packages_apps_Snap-0af30e77da5ca7995f185879c701004ca6a0dc1a.tar.gz android_packages_apps_Snap-0af30e77da5ca7995f185879c701004ca6a0dc1a.tar.bz2 android_packages_apps_Snap-0af30e77da5ca7995f185879c701004ca6a0dc1a.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.java | 5 |
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); } |