code: public static int computeSampleSize(BitmapFactory.Options options, int minSideLength, int maxNumOfPixels) {
          int initialSize = computeInitialSampleSize(options, minSideLength, maxNumOfPixels);
          int roundedSize;
          if (initialSize <= 8) {
              roundedSize = 1;
              while (roundedSize < initialSize) {
                  roundedSize <<= 1;
              }
          } else {
              roundedSize = (initialSize + 7) / 8 * 8;
          }
          return roundedSize;
      }
docs: 获取缩放倍率
  
  @param options        原始图片的基本信息
  @param minSideLength  图片最小边尺寸
  @param maxNumOfPixels 要压缩成的图片的像素总数