preview method

CdnPathBuilder preview([
  1. int? width,
  2. int? height
])

Reduces an image proportionally in order to fit it into given dimensions.

@param width New width @param height New height

Implementation

CdnPathBuilder preview([int? width, int? height]) {
  sb.write('/-/preview/');
  if (width != null) {
    dimensionGuard(width);
    sb.write(width);
  }
  if (width != null || height != null) {
    sb.write('x');
  }
  if (height != null) {
    dimensionGuard(height);
    sb.write(height);
  }
  return this;
}