mirror of https://github.com/M66B/FairEmail.git
Always scale to smaller as target size
This commit is contained in:
parent
6724409255
commit
599c220ef5
|
@ -225,7 +225,10 @@ public class Helper {
|
|||
options.inJustDecodeBounds = true;
|
||||
BitmapFactory.decodeFile(file.getAbsolutePath(), options);
|
||||
|
||||
int factor = Math.min(options.outWidth / scaleToPixels, options.outWidth / scaleToPixels);
|
||||
int factor = 1;
|
||||
while (options.outWidth / factor > scaleToPixels)
|
||||
factor *= 2;
|
||||
|
||||
if (factor > 1) {
|
||||
Log.i("Decode image factor=" + factor);
|
||||
options.inJustDecodeBounds = false;
|
||||
|
|
Loading…
Reference in New Issue