getSize static method

Size getSize(
  1. ImageInput input
)

Get the size of the input.

If the input not exists, it will throw StateError.

If the input is not a valid image format, it will throw UnsupportedError.

Implementation

static Size getSize(ImageInput input) {
  if (!input.exists()) {
    throw StateError('The input is not exists.');
  }

  for (var value in _decoders) {
    if (value.isValid(input)) {
      return value.getSize(input);
    }
  }

  throw UnsupportedError('The input is not supported.');
}