A tool for archiving & converting scans of postcards, and information about them.

fix: fix failing tests after card colour

+5 -2
+1 -1
formats/xmp/decode.go
··· 109 if thick, err := strconv.ParseFloat(js.Models.Postcard.PhysicalThicknessMM, 64); err == nil { 110 meta.Physical.ThicknessMM = thick 111 } 112 - if c, err := types.ColorFromString(js.Models.Postcard.CardColor); err != nil { 113 meta.Physical.CardColor = c 114 } 115
··· 109 if thick, err := strconv.ParseFloat(js.Models.Postcard.PhysicalThicknessMM, 64); err == nil { 110 meta.Physical.ThicknessMM = thick 111 } 112 + if c, err := types.ColorFromString(js.Models.Postcard.CardColor); err == nil { 113 meta.Physical.CardColor = c 114 } 115
+1
internal/testhelpers/sample-meta.yaml
··· 48 physical: 49 front_size: 14.80cm x 10.50cm 50 thickness_mm: 0.4
··· 48 physical: 49 front_size: 14.80cm x 10.50cm 50 thickness_mm: 0.4 51 + card_color: '#E6E6D9'
pkg/xmpinject/1px-xmp.jpg

This is a binary file and will not be displayed.

pkg/xmpinject/1px-xmp.png

This is a binary file and will not be displayed.

pkg/xmpinject/1px-xmp.webp

This is a binary file and will not be displayed.

+1
types/color.go
··· 18 R: r, 19 G: g, 20 B: b, 21 }, nil 22 } 23
··· 18 R: r, 19 G: g, 20 B: b, 21 + A: 0xff, 22 }, nil 23 } 24
+2 -1
types/yaml.go
··· 157 } 158 159 func (c Color) MarshalYAML() (interface{}, error) { 160 - return fmt.Sprintf(`"#%02X%02X%02X"`, c.R, c.G, c.B), nil 161 } 162 163 func (c *Color) UnmarshalYAML(y *yaml.Node) error { ··· 171 } 172 173 c.R, c.G, c.B = r, g, b 174 return nil 175 } 176
··· 157 } 158 159 func (c Color) MarshalYAML() (interface{}, error) { 160 + return fmt.Sprintf(`#%02X%02X%02X`, c.R, c.G, c.B), nil 161 } 162 163 func (c *Color) UnmarshalYAML(y *yaml.Node) error { ··· 171 } 172 173 c.R, c.G, c.B = r, g, b 174 + c.A = 255 175 return nil 176 } 177