@Override
        protected int getSampleSize(int inWidth, int inHeight, int outWidth, int outHeight) {
            int maxIntegerFactor = (int) Math.ceil(Math.max(inHeight / (float) outHeight,
                inWidth / (float) outWidth));
            int lesserOrEqualSampleSize = Math.max(1, Integer.highestOneBit(maxIntegerFactor));
            return lesserOrEqualSampleSize << (lesserOrEqualSampleSize < maxIntegerFactor ? 1 : 0);
        }
Load and scale the image uniformly (maintaining the image's aspect ratio) so that largest edge of the image
will be between 1/2x and 1x of the requested size. The smaller edge has no minimum size.
core/src/main/java/com/bumptech/glide/load/resource/bitmap/Downsampler.java