code: private function getImageMimeType($pFile)
      {
          if (File::fileExists($pFile)) {
              $image = getimagesize($pFile);
  
              return image_type_to_mime_type($image[2]);
          }
  
          throw new WriterException("File $pFile does not exist");
      }
docs: Get image mime type.
  
  @param string $pFile Filename
  
  @throws WriterException
  
  @return string Mime Type