1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-03 13:44:40 +00:00

Fixed scaling of inline images

This commit is contained in:
M66B 2024-10-16 15:22:30 +02:00
parent ae803e4719
commit 0bfd8bf015

View file

@ -568,6 +568,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
float scale = (textSize == 0 ? 1.0f : size / (textSize * message_zoom / 100f));
boolean show_images = properties.getValue("images", message.id);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean inline = prefs.getBoolean("inline_images", false);
if (scale > 10)
return true;
@ -578,11 +581,13 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
// Image size
Spanned spanned = (Spanned) tvBody.getText();
for (ImageSpan img : spanned.getSpans(0, spanned.length(), ImageSpan.class)) {
String source = img.getSource();
boolean embedded = (source != null && source.startsWith("cid:"));
Drawable d = img.getDrawable();
int w = 0;
int h = 0;
if (img instanceof ImageSpanEx) {
if (show_images) {
if (show_images || (embedded && inline)) {
w = ((ImageSpanEx) img).getWidth();
h = ((ImageSpanEx) img).getHeight();
} else {