code: public static Bitmap getBitmapBySize(String path, int width, int height) {
          BitmapFactory.Options option = new BitmapFactory.Options();
          option.inJustDecodeBounds = true;
          BitmapFactory.decodeFile(path, option);
          option.inSampleSize = computeSampleSize(option, -1, width * height);
  
          option.inJustDecodeBounds = false;
          Bitmap bitmap = null;
          try {
              bitmap = BitmapFactory.decodeFile(path, option);
          } catch (Exception e) {
              e.printStackTrace();
          }
          return bitmap;
      }
docs: 将指定的图片压缩成需要的尺寸
  
  @param path   图片的路径
  @param width  要压缩成的图片的宽度
  @param height 要压缩成的图片的高度