-
-
Save pkieltyka/5f565ee8510c4091f381 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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