docs: public static Bitmap loadThumbnail(@NonNull Context context, @DrawableRes final int resourceId,
                                         final int maxWidth, final int maxHeight) throws IOException {
          Pair<Integer, Integer> imageDimensions = getImageDimensions(context, resourceId);
          int sampleSize = getSampleSize(imageDimensions, maxWidth, maxHeight);
          BitmapFactory.Options options = new BitmapFactory.Options();
          options.inJustDecodeBounds = false;
          options.inSampleSize = sampleSize;
          Bitmap thumbnail =
                  BitmapFactory.decodeResource(context.getResources(), resourceId, options);
  
          if (thumbnail == null) {
              throw new IOException("Failed to decode image resource with id " + resourceId);
          }
  
          return thumbnail;
      }