docs: private static int getSampleSize(@NonNull final Pair<Integer, Integer> imageDimensions,
                                       final int maxWidth, final int maxHeight) {
          Condition.INSTANCE.ensureNotNull(imageDimensions, "The image dimensions may not be null");
          Condition.INSTANCE.ensureAtLeast(maxWidth, 1, "The maximum width must be at least 1");
          Condition.INSTANCE.ensureAtLeast(maxHeight, 1, "The maximum height must be at least 1");
          int width = imageDimensions.first;
          int height = imageDimensions.second;
          int sampleSize = 1;
  
          if (width > maxWidth || height > maxHeight) {
              int halfWidth = width / 2;
              int halfHeight = height / 2;
  
              while ((halfWidth / sampleSize) > maxWidth && (halfHeight / sampleSize) > maxHeight) {
                  sampleSize *= 2;
              }
          }
  
          return sampleSize;
      }