mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-05 12:24:26 +01:00
Reduce memory usage
This commit is contained in:
@@ -325,7 +325,7 @@ public class HtmlHelper {
|
||||
return d;
|
||||
} else {
|
||||
Bitmap bm = Helper.decodeImage(attachment.getFile(view.getContext()),
|
||||
res.getDisplayMetrics().widthPixels * 2);
|
||||
res.getDisplayMetrics().widthPixels);
|
||||
if (bm == null) {
|
||||
Log.i("Image not decodable CID=" + cid);
|
||||
Drawable d = res.getDrawable(R.drawable.baseline_broken_image_24, theme);
|
||||
@@ -400,7 +400,7 @@ public class HtmlHelper {
|
||||
Log.i("Download " + source);
|
||||
Bitmap bm;
|
||||
try (InputStream is = new URL(source).openStream()) {
|
||||
int scaleTo = res.getDisplayMetrics().widthPixels * 2;
|
||||
int scaleTo = res.getDisplayMetrics().widthPixels;
|
||||
int factor = 1;
|
||||
while (options.outWidth / factor > scaleTo)
|
||||
factor *= 2;
|
||||
|
||||
Reference in New Issue
Block a user