mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-27 03:15:39 +01:00
Skip rendering large SVG media files
This commit is contained in:
@@ -83,6 +83,7 @@ public class AdapterMedia extends RecyclerView.Adapter<AdapterMedia.ViewHolder>
|
||||
private List<EntityAttachment> items = new ArrayList<>();
|
||||
|
||||
private static final int PDF_WIDTH = 120;
|
||||
private static final int MAX_SVG_FILE_SIZE = 1024 * 1024;
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener, View.OnLongClickListener {
|
||||
private final View view;
|
||||
@@ -202,6 +203,8 @@ public class AdapterMedia extends RecyclerView.Adapter<AdapterMedia.ViewHolder>
|
||||
|
||||
if ("image/webp".equalsIgnoreCase(type) && !webp)
|
||||
return context.getDrawable(R.drawable.twotone_image_not_supported_24);
|
||||
if ("image/svg+xml".equalsIgnoreCase(type) && file.length() > MAX_SVG_FILE_SIZE)
|
||||
return context.getDrawable(R.drawable.twotone_image_not_supported_24);
|
||||
|
||||
try {
|
||||
BitmapFactory.Options options = new BitmapFactory.Options();
|
||||
|
||||
Reference in New Issue
Block a user