Rename 'scale' to 'inSampleSize' for clarity.

parent 428247b7
Pipeline #3627 passed with stage
in 9 minutes and 1 second
...@@ -160,15 +160,15 @@ class AttachmentCreationTask { ...@@ -160,15 +160,15 @@ class AttachmentCreationTask {
if (LOG.isLoggable(INFO)) if (LOG.isLoggable(INFO))
LOG.info("Original image size: " + size.width + "x" + size.height); LOG.info("Original image size: " + size.width + "x" + size.height);
int dimension = Math.max(size.width, size.height); int dimension = Math.max(size.width, size.height);
int scale = 1; int inSampleSize = 1;
while (dimension > MAX_ATTACHMENT_DIMENSION) { while (dimension > MAX_ATTACHMENT_DIMENSION) {
scale *= 2; inSampleSize *= 2;
dimension /= 2; dimension /= 2;
} }
if (LOG.isLoggable(INFO)) if (LOG.isLoggable(INFO))
LOG.info("Scaling attachment by factor of " + scale); LOG.info("Scaling attachment by factor of " + inSampleSize);
Options options = new Options(); Options options = new Options();
options.inSampleSize = scale; options.inSampleSize = inSampleSize;
Bitmap bitmap = decodeStream(is, null, options); Bitmap bitmap = decodeStream(is, null, options);
if (bitmap == null) throw new IOException(); if (bitmap == null) throw new IOException();
return bitmap; return bitmap;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment