From 022592a5744d1a4c208afbaebaa055e05e42f783 Mon Sep 17 00:00:00 2001 From: sictiru Date: Thu, 25 Mar 2021 16:27:30 -0700 Subject: [PATCH] #1438 Downsample large images and max out at 800px --- .../android/NewsBlur/src/com/newsblur/util/ImageLoader.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/clients/android/NewsBlur/src/com/newsblur/util/ImageLoader.java b/clients/android/NewsBlur/src/com/newsblur/util/ImageLoader.java index 6030a1134..abab7e4d8 100644 --- a/clients/android/NewsBlur/src/com/newsblur/util/ImageLoader.java +++ b/clients/android/NewsBlur/src/com/newsblur/util/ImageLoader.java @@ -59,7 +59,7 @@ public class ImageLoader { } public PhotoToLoad displayImage(String url, ImageView imageView, float roundRadius, boolean cropSquare) { - return displayImage(url, imageView, roundRadius, cropSquare, Integer.MAX_VALUE, false); + return displayImage(url, imageView, roundRadius, cropSquare, imageView.getHeight(), false); } /** @@ -179,8 +179,9 @@ public class ImageLoader { if (!isUrlMapped(photoToLoad.imageView, photoToLoad.url)) return; // callers frequently might botch this due to lazy view measuring + // limit max dimensions to 800px if (photoToLoad.maxDimPX < 1) { - photoToLoad.maxDimPX = Integer.MAX_VALUE; + photoToLoad.maxDimPX = 800; } // try from disk