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 109 if thick, err := strconv.ParseFloat(js.Models.Postcard.PhysicalThicknessMM, 64); err == nil { 110 110 meta.Physical.ThicknessMM = thick 111 111 } 112 - if c, err := types.ColorFromString(js.Models.Postcard.CardColor); err != nil { 112 + if c, err := types.ColorFromString(js.Models.Postcard.CardColor); err == nil { 113 113 meta.Physical.CardColor = c 114 114 } 115 115
+1
internal/testhelpers/sample-meta.yaml
··· 48 48 physical: 49 49 front_size: 14.80cm x 10.50cm 50 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 18 R: r, 19 19 G: g, 20 20 B: b, 21 + A: 0xff, 21 22 }, nil 22 23 } 23 24
+2 -1
types/yaml.go
··· 157 157 } 158 158 159 159 func (c Color) MarshalYAML() (interface{}, error) { 160 - return fmt.Sprintf(`"#%02X%02X%02X"`, c.R, c.G, c.B), nil 160 + return fmt.Sprintf(`#%02X%02X%02X`, c.R, c.G, c.B), nil 161 161 } 162 162 163 163 func (c *Color) UnmarshalYAML(y *yaml.Node) error { ··· 171 171 } 172 172 173 173 c.R, c.G, c.B = r, g, b 174 + c.A = 255 174 175 return nil 175 176 } 176 177