title: Check if an image is valid PNG file
body: <p>I am having troubles with downloading images in binary format, sometimes a downloaded file is corrupted image. </p>
  
  <p>So I need to check whether downloaded file is a valid PNG image. </p>
  
  <p>I have already tried this library <a href="https://github.com/sindresorhus/is-png" rel="nofollow noreferrer">Is-png</a>, but it reads only first 8 bytes of the file and doesn't consider a whole file. </p>
  
  <p>So I need to find a library that could check whether a whole file is valid png image or not.</p>
  
  <p>Please suggest the best way to achieve this, maybe there are some great tools already exist.</p>
  
  <p>Thanks</p>