exifmetadata-extractor

MetadataExtractor File format could not be determined


I'm using metadataExtractor (v.2.7.1) in .Net Core (3.0.1) to get the date of the photos.

  var file = Request.Form.Files[0];
  try
  {
      IEnumerable<MetadataExtractor.Directory> directories = ImageMetadataReader.ReadMetadata(file.OpenReadStream());
  ....
  }

And I get sometimes this exception on this line "File format could not be determined"

Any idea what is wrong? This photo seems to be correct and having the exif metadata I need.

The code is working for other photos.

Thank you in advance


Solution

  • The problem was that this photo was larger than the other one and was uploaded in chunck. I was trying to get EXIF from each chunk, which is not possible...