Skip to content
Snippets Groups Projects
Verified Commit 95d06770 authored by akwizgran's avatar akwizgran
Browse files

Rename 'scale' to 'inSampleSize' for clarity.

parent 428247b7
No related branches found
No related tags found
No related merge requests found
...@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment