-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
52 lines (43 loc) · 900 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package main
import (
"encoding/json"
"fmt"
"os"
"time"
"github.com/recentralized/structure/data"
"github.com/recentralized/structure/meta"
)
func main() {
meta, err := buildMeta()
if err != nil {
fmt.Printf("Failed to build meta: %s", err)
os.Exit(1)
}
data, err := json.MarshalIndent(meta, "", " ")
if err != nil {
fmt.Printf("Failed to create json: %s", err)
os.Exit(1)
}
fmt.Println(string(data))
}
func buildMeta() (*meta.Meta, error) {
doc := meta.New()
doc.Type = data.JPG
doc.Size = 1024
doc.Inherent = meta.Content{
Created: time.Date(2018, 1, 1, 0, 0, 0, 0, time.UTC),
Image: meta.Image{
Width: 3000,
Height: 5000,
},
Exif: meta.Exif{
"ExposureTime": meta.ExifValue{ID: "ShutterSpeed", Val: "1/60"},
},
}
doc.Sidecar = meta.Content{
Exif: meta.Exif{
"FNumber": meta.ExifValue{ID: "0x829d", Val: 1.8},
},
}
return doc, nil
}