Skip to content

Instantly share code, notes, and snippets.

@pkieltyka
Created December 16, 2015 14:17
Show Gist options
  • Save pkieltyka/5f565ee8510c4091f381 to your computer and use it in GitHub Desktop.
Save pkieltyka/5f565ee8510c4091f381 to your computer and use it in GitHub Desktop.
func exifTool(input io.Reader) (*ExifProperties, error) {
cmd := exec.Command("exiftool", "-json", "-")
cmd.Stdin = input
var out bytes.Buffer
cmd.Stdout = &out
err := cmd.Run()
if err != nil {
return nil, err
}
data := []ExifProperties{}
json.Unmarshal(out.Bytes(), &data)
meta := &data[0]
return meta, nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment