diff --git a/app/src/main/java/eu/faircode/email/ContactInfo.java b/app/src/main/java/eu/faircode/email/ContactInfo.java index b3ec1eb6c9..0621b8f5f9 100644 --- a/app/src/main/java/eu/faircode/email/ContactInfo.java +++ b/app/src/main/java/eu/faircode/email/ContactInfo.java @@ -103,6 +103,7 @@ public class ContactInfo { private static Map emailLookup = new ConcurrentHashMap<>(); private static final Map emailContactInfo = new HashMap<>(); + private static final int CONTACT_ICON_SIZE = 64; // dp private static final int GENERATED_ICON_SIZE = 48; // dp private static final int FAVICON_ICON_SIZE = 64; // dp private static final int FAVICON_CONNECT_TIMEOUT = 5 * 1000; // milliseconds @@ -320,11 +321,12 @@ public class ContactInfo { long contactId = cursor.getLong(colContactId); String lookupKey = cursor.getString(colLookupKey); Uri lookupUri = ContactsContract.Contacts.getLookupUri(contactId, lookupKey); + int px = Helper.dp2pixels(context, CONTACT_ICON_SIZE); if (avatars) try (InputStream is = ContactsContract.Contacts.openContactPhotoInputStream( resolver, lookupUri, false)) { - info.bitmap = BitmapFactory.decodeStream(is); + info.bitmap = ImageHelper.getScaledBitmap(is, lookupUri.toString(), null, px); info.type = "contact"; } catch (Throwable ex) { Log.e(ex);