Fixed image scaling

This commit is contained in:
M66B
2019-02-20 07:47:14 +00:00
parent 7f6a7033a7
commit 130d2149f2
2 changed files with 9 additions and 4 deletions

View File

@@ -280,7 +280,10 @@ public class HtmlHelper {
is = new URL(source).openStream();
int scaleTo = context.getResources().getDisplayMetrics().widthPixels;
int factor = Math.min(options.outWidth / scaleTo, options.outWidth / scaleTo);
int factor = 1;
while (options.outWidth / factor > scaleTo)
factor *= 2;
if (factor > 1) {
Log.i("Download image factor=" + factor);
options.inJustDecodeBounds = false;