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

Commit 80d119bf authored by Alexandra Gherghina's avatar Alexandra Gherghina
Browse files

Fix image conversion

For some images, especially those in the bug linked, the conversion would
yield empty images otherwise.

Bug: 18311493
Change-Id: I90150a8837655df3c9c35b36eb02594807eb0a06
parent 84644f10
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -48,9 +48,12 @@ public class UserIcons {
        if (icon == null) {
            return null;
        }
        Bitmap bitmap = Bitmap.createBitmap(icon.getIntrinsicWidth(), icon.getIntrinsicHeight(),
                Bitmap.Config.ARGB_8888);
        icon.draw(new Canvas(bitmap));
        final int width = icon.getIntrinsicWidth();
        final int height = icon.getIntrinsicHeight();
        Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
        Canvas canvas = new Canvas(bitmap);
        icon.setBounds(0, 0, width, height);
        icon.draw(canvas);
        return bitmap;
    }