diff options
Diffstat (limited to 'src/com/android/gallery3d/photoeditor/BitmapUtils.java')
-rw-r--r-- | src/com/android/gallery3d/photoeditor/BitmapUtils.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/com/android/gallery3d/photoeditor/BitmapUtils.java b/src/com/android/gallery3d/photoeditor/BitmapUtils.java index a3a18d217..9b4114394 100644 --- a/src/com/android/gallery3d/photoeditor/BitmapUtils.java +++ b/src/com/android/gallery3d/photoeditor/BitmapUtils.java @@ -181,15 +181,13 @@ public class BitmapUtils { * Saves the bitmap by given directory, filename, and format; if the directory is given null, * then saves it under the cache directory. */ - public File saveBitmap( - Bitmap bitmap, String directory, String filename, CompressFormat format) { + public File saveBitmap(Bitmap bitmap, File directory, String filename, CompressFormat format) { if (directory == null) { - directory = context.getCacheDir().getAbsolutePath(); + directory = context.getCacheDir(); } else { // Check if the given directory exists or try to create it. - File file = new File(directory); - if (!file.isDirectory() && !file.mkdirs()) { + if (!directory.isDirectory() && !directory.mkdirs()) { return null; } } |