summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/filtershow/tools
diff options
context:
space:
mode:
authorJohn Hoford <hoford@google.com>2013-08-20 15:37:37 -0700
committerJohn Hoford <hoford@google.com>2013-08-20 15:47:11 -0700
commit441d7a8930360d1c043daabd76a6599f2a8a60ba (patch)
tree5ee5741dc2a531a06a2021798fe19888d724bc70 /src/com/android/gallery3d/filtershow/tools
parent675948f8f6337fe2873067a74db789d46a41ec36 (diff)
downloadandroid_packages_apps_Gallery2-441d7a8930360d1c043daabd76a6599f2a8a60ba.tar.gz
android_packages_apps_Gallery2-441d7a8930360d1c043daabd76a6599f2a8a60ba.tar.bz2
android_packages_apps_Gallery2-441d7a8930360d1c043daabd76a6599f2a8a60ba.zip
fix gif issue
bug:7877538 Change-Id: I807198ca6d0d0db33fdbcc8b6bd1bf6dab9ba86a
Diffstat (limited to 'src/com/android/gallery3d/filtershow/tools')
-rw-r--r--src/com/android/gallery3d/filtershow/tools/SaveImage.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/filtershow/tools/SaveImage.java b/src/com/android/gallery3d/filtershow/tools/SaveImage.java
index 5aafbff33..abcdcf820 100644
--- a/src/com/android/gallery3d/filtershow/tools/SaveImage.java
+++ b/src/com/android/gallery3d/filtershow/tools/SaveImage.java
@@ -436,6 +436,17 @@ public class SaveImage {
// We are using the destination file name such that photos sitting in
// the auxiliary directory are matching the parent directory.
File newSrcFile = new File(auxDiretory, dstFile.getName());
+ // Maintain the suffix during move
+ String to = newSrcFile.getName();
+ String from = srcFile.getName();
+ to = to.substring(to.lastIndexOf("."));
+ from = from.substring(from.lastIndexOf("."));
+
+ if (!to.equals(from)) {
+ String name = dstFile.getName();
+ name = name.substring(0, name.lastIndexOf(".")) + from;
+ newSrcFile = new File(auxDiretory, name);
+ }
if (!newSrcFile.exists()) {
srcFile.renameTo(newSrcFile);