title: Read Exif Metadata with Go
body: <p>Does anyone have an example on using "github.com/gohugoio/hugo/resources/images/exif" to extract metadata from a local image using Go?</p>
  
  <p>I looked through the docs and since I'm new to Go I'm not 100% sure if I'm doing things write. I do read the image, but I'm not sure what the next step would be.</p>
  
  <pre><code>fname := "image.jpg"
  f, err := os.Open(fname)
  if err != nil {
    log.Fatal("Error: ", err)
  }
  </code></pre>
  
  <p>(Edit 1)
  Actually I think I found a solution:</p>
  
  <pre><code>d, err := exif.NewDecoder(exif.IncludeFields("File Type"))
  x, err := d.Decode(f)
  if err != nil {
    log.Fatal("Error: ", err)
  }
  fmt.Println(x)
  </code></pre>
  
  <p>however, the question is how do I know what fields are available? <code>File Type</code> for example returns <code>&lt;nil&gt;</code></p>