Loading res/values/filtershow_strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,8 @@ <!-- String shown when we cannot load the image when starting the activity [CHAR LIMIT=NONE] --> <string name="cannot_load_image">Cannot load the image!</string> <!-- String shown when we cannot load the original to edit [CHAR LIMIT=NONE] --> <string name="cannot_edit_original">Cannot edit original</string> <!-- String displayed when showing the original image [CHAR LIMIT=NONE] --> <string name="original_picture_text">@string/original</string> <!-- String displayed when setting the homepage wallpaper in the background [CHAR LIMIT=NONE] --> Loading src/com/android/gallery3d/filtershow/FilterShowActivity.java +9 −3 Original line number Diff line number Diff line Loading @@ -732,9 +732,15 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL } if (!result) { if (!mOriginalImageUri.equals(mSelectedImageUri)) { mOriginalImageUri = mSelectedImageUri; mOriginalPreset = null; Toast.makeText(FilterShowActivity.this, R.string.cannot_edit_original, Toast.LENGTH_SHORT).show(); startLoadBitmap(mOriginalImageUri); } else { cannotLoadImage(); // TODO: We should figure out the best way preventing this from // happening, e.g: early checking. } return; } Loading src/com/android/gallery3d/filtershow/cache/ImageLoader.java +3 −0 Original line number Diff line number Diff line Loading @@ -392,6 +392,9 @@ public final class ImageLoader { Bitmap bmap = loadConstrainedBitmap(uri, context, maxSideLength, originalBounds, false); if (bmap != null) { bmap = orientBitmap(bmap, orientation); if (bmap.getConfig()!= Bitmap.Config.ARGB_8888){ bmap = bmap.copy( Bitmap.Config.ARGB_8888,true); } } return bmap; } Loading src/com/android/gallery3d/filtershow/tools/SaveImage.java +11 −0 Original line number Diff line number Diff line Loading @@ -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); Loading Loading
res/values/filtershow_strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,8 @@ <!-- String shown when we cannot load the image when starting the activity [CHAR LIMIT=NONE] --> <string name="cannot_load_image">Cannot load the image!</string> <!-- String shown when we cannot load the original to edit [CHAR LIMIT=NONE] --> <string name="cannot_edit_original">Cannot edit original</string> <!-- String displayed when showing the original image [CHAR LIMIT=NONE] --> <string name="original_picture_text">@string/original</string> <!-- String displayed when setting the homepage wallpaper in the background [CHAR LIMIT=NONE] --> Loading
src/com/android/gallery3d/filtershow/FilterShowActivity.java +9 −3 Original line number Diff line number Diff line Loading @@ -732,9 +732,15 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL } if (!result) { if (!mOriginalImageUri.equals(mSelectedImageUri)) { mOriginalImageUri = mSelectedImageUri; mOriginalPreset = null; Toast.makeText(FilterShowActivity.this, R.string.cannot_edit_original, Toast.LENGTH_SHORT).show(); startLoadBitmap(mOriginalImageUri); } else { cannotLoadImage(); // TODO: We should figure out the best way preventing this from // happening, e.g: early checking. } return; } Loading
src/com/android/gallery3d/filtershow/cache/ImageLoader.java +3 −0 Original line number Diff line number Diff line Loading @@ -392,6 +392,9 @@ public final class ImageLoader { Bitmap bmap = loadConstrainedBitmap(uri, context, maxSideLength, originalBounds, false); if (bmap != null) { bmap = orientBitmap(bmap, orientation); if (bmap.getConfig()!= Bitmap.Config.ARGB_8888){ bmap = bmap.copy( Bitmap.Config.ARGB_8888,true); } } return bmap; } Loading
src/com/android/gallery3d/filtershow/tools/SaveImage.java +11 −0 Original line number Diff line number Diff line Loading @@ -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); Loading