javascript – Only accept photos smaller than 1920×1080

How do I only accept photos (from the file explorer) smaller that 1920×1080. Otherwise, my entire webpage get flooded with one image. Here is my code for importing the photos:

Html:

<input type="file" id="file" accept="image/png, img/jpeg">

Javascript:

    function Read(){
    var file = document.getElementById("file").files(0);
    var reader  = new FileReader();
    reader.onload = function(e)  {
        var image = document.createElement("img");
        // the result image data
        image.src = e.target.result;
        document.body.appendChild(image);
  }
    reader.readAsDataURL(file);
  }