diff options
Diffstat (limited to 'src/com/android/camera/Storage.java')
-rw-r--r-- | src/com/android/camera/Storage.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/com/android/camera/Storage.java b/src/com/android/camera/Storage.java index aa0fbb71e..e748af5f3 100644 --- a/src/com/android/camera/Storage.java +++ b/src/com/android/camera/Storage.java @@ -71,12 +71,12 @@ public class Storage { mRoot = root; } - public void writeFile(String path, byte[] jpeg, ExifInterface exif, + public int writeFile(String path, byte[] jpeg, ExifInterface exif, String mimeType) { if (exif != null && (mimeType == null || mimeType.equalsIgnoreCase("jpeg"))) { try { - exif.writeExif(jpeg, path); + return exif.writeExif(jpeg, path); } catch (Exception e) { Log.e(TAG, "Failed to write data", e); } @@ -85,8 +85,9 @@ public class Storage { File dir = new File(generateRawDirectory()); dir.mkdirs(); } - writeFile(path, jpeg); + return jpeg.length; } + return 0; } public void writeFile(String path, byte[] data) { @@ -111,9 +112,9 @@ public class Storage { int height, String mimeType) { String path = generateFilepath(title, mimeType); - writeFile(path, jpeg, exif, mimeType); + int size = writeFile(path, jpeg, exif, mimeType); return addImage(resolver, title, date, location, orientation, - jpeg.length, path, width, height, mimeType); + size, path, width, height, mimeType); } // Get a ContentValues object for the given photo data |