resize static method

  1. @Deprecated('Use copyResize from package image instead')
Image resize(
  1. Image image, {
  2. int maxSize = MAX_IMAGE_SIZE,
})

Returns a copy of the image with its bigger size GTE maxsize

Implementation

// TODO: deprecated from 2022-08-18; remove when old enough, and pubspec.yaml's dependency on "image" too
@Deprecated('Use copyResize from package image instead')
static Image resize(Image image, {int maxSize = MAX_IMAGE_SIZE}) {
  // check if the image is already small enough
  if (image.width <= maxSize || image.height <= maxSize) {
    return image;
  }

  // resize the image
  if (image.width > image.height) {
    return copyResize(image, width: maxSize);
  } else {
    return copyResize(image, height: maxSize);
  }
}