Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d74271e5 authored by John Hoford's avatar John Hoford Committed by Android (Google) Code Review
Browse files

Merge "fix gif issue" into gb-ub-photos-carlsbad

parents 82f3ed2c 441d7a89
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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] -->
+9 −3
Original line number Diff line number Diff line
@@ -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;
            }

+3 −0
Original line number Diff line number Diff line
@@ -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;
    }
+11 −0
Original line number Diff line number Diff line
@@ -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);