title: org.apache.commons.imaging.ImageReadException: Couldn't read magic numbers to guess format
body: <p>I am trying to upload an image via jsp and at back end i am trying to read its metadata. But i am getting this error</p>
  
  <blockquote>
    <p>org.apache.commons.imaging.ImageReadException: Couldn't read magic numbers to guess format.</p>
  </blockquote>
  
  <pre><code>final ImageMetadata metadata = Imaging.getMetadata(file.getBytes());
  </code></pre>
  
  <p>The problem is the object file is of MultipartFile and instead of it, it should be of type File.</p>