isJpeg static method

bool isJpeg(
  1. List<int>? imageData
)

Check whether the picture is jpeg.

Implementation

static bool isJpeg(List<int>? imageData) {
  if (imageData != null && imageData.length >= _jpegSignature.length) {
    for (int i = 0; i < _jpegSignature.length; i++) {
      if (_jpegSignature[i] != imageData[i]) {
        return false;
      }
    }
    return true;
  } else {
    return false;
  }
}