checkImageThumb static method

bool checkImageThumb(
  1. Thumb thumb,
  2. int width,
  3. int height
)

Implementation

static bool checkImageThumb(Thumb thumb, int width, int height) {
  // not allow negative
  if (width < 0 || height < 0) {
    return false;
  }

  switch (thumb) {
    case Thumb.Internal:
      // not allow both zero
      return width > 0 || height > 0;
    case Thumb.Crop:
    case Thumb.External:
      // not allow either zero
      return width > 0 && height > 0;
  }
}