diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index 8ee5d99030..f7133a8b62 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -3750,7 +3750,7 @@ public class AdapterMessage extends RecyclerView.Adapter IMAGE_TYPES = Collections.unmodifiableList(Arrays.asList( @@ -280,7 +280,8 @@ class ImageHelper { @NonNull static Bitmap renderSvg(InputStream _is, int fillColor, int scaleToPixels) throws IOException { - try (InputStream is = new Helper.MaximumLengthStream(_is, 1024 * 1024)) { + // https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/ + try (InputStream is = new Helper.MaximumLengthStream(_is, MAX_SVG_SIZE)) { // https://bugzilla.mozilla.org/show_bug.cgi?id=455100 // https://bug1105796.bmoattachments.org/attachment.cgi?id=8529795 // https://github.com/BigBadaboom/androidsvg/issues/122#issuecomment-361902061 @@ -335,6 +336,7 @@ class ImageHelper { boolean show, int zoom, final float scale, final TextView view) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); boolean inline = prefs.getBoolean("inline_images", false); + boolean svg = prefs.getBoolean("svg", true); boolean webp = prefs.getBoolean("webp", true); final int px = Helper.dp2pixels(context, (zoom + 1) * 24); @@ -363,6 +365,10 @@ class ImageHelper { Drawable d = ContextCompat.getDrawable(context, R.drawable.twotone_broken_image_24); d.setBounds(0, 0, px, px); return d; + } else if ("image/svg+xml".equalsIgnoreCase(attachment.type) && !svg) { + Drawable d = ContextCompat.getDrawable(context, R.drawable.twotone_warning_24); + d.setBounds(0, 0, px, px); + return d; } else if ("image/webp".equalsIgnoreCase(attachment.type) && !webp) { Drawable d = ContextCompat.getDrawable(context, R.drawable.twotone_warning_24); d.setBounds(0, 0, px, px);