This commit is contained in:
nuclearfog 2023-03-26 14:45:33 +02:00
parent c58eaf2094
commit ff86c82557
No known key found for this signature in database
GPG Key ID: 03488A185C476379

View File

@ -50,7 +50,11 @@ public class EmojiLoader extends AsyncExecutor<EmojiLoader.EmojiParam, EmojiLoad
icon = BitmapFactory.decodeStream(input);
cache.putImage(emoji.getCode(), icon);
}
icon = Bitmap.createScaledBitmap(icon, param.size, param.size, false);
if (icon.getHeight() > 0 && icon.getWidth() > 0) {
icon = Bitmap.createScaledBitmap(icon, icon.getWidth() * param.size / icon.getHeight(), param.size, false);
} else {
icon = Bitmap.createScaledBitmap(icon, param.size, param.size, false);
}
result.put(emoji.getCode(), icon);
}
cache.trimCache();