···11# TODO
2233-- [ ] JPEGli in SVG with mask smaller than WebP?
33+- [ ] Coregistration of front and back (slight rotation & translation differences)
44+- [x] JPEGli in SVG with mask smaller than PNG?
45- [ ] Improve HasTransparency detection (for all format decoding)
56- [ ] Move component/decode.go#decodeImage to internal/images/decode.go?
67- [ ] Fix XMP inject/extract tests
···1112- [ ] Store number of sides in the Metadata
1213- [ ] Validate the number of sides in the metadata with the number of images provided
1314- [ ] Allow conversion of postcard files on PostOffice
1414-- [ ] Coregistration of front and back (slight rotation & translation differences)
1515- [ ] Allow uploading/choice of SVGs for the back side, to make a "blank" postcard
1616 - [ ] Responsive layout for the back — in physical units
1717 - [ ] Rendering SVG inside go/wasm
+3-1
formats.go
···2121var codecs = map[string]formats.Codec{
2222 "component": component.Codec(),
2323 "web": web.DefaultCodec,
2424+ "svg": web.SVGCodec,
2425 "usd": usd.Codec(),
2526 "usdz": usdz.Codec(),
2627 "json": metadata.Codec(metadata.AsJSON),
···2829 "xmp": xmp.Codec(),
2930}
30313131-var Codecs = []string{"component", "web", "usdz", "usd", "json", "yaml", "xmp"}
3232+// Used for ordering
3333+var Codecs = []string{"component", "web", "svg", "usdz", "usd", "json", "yaml", "xmp"}
32343335// These 'formats' will trigger the IncludeSupportFiles encoder option instead of a different codec
3436var supportFiles = []string{"css", "html"}
+1-1
formats/usd/codec.go
···159159 maxX, maxY := pc.Meta.Physical.FrontDimensions.MustPhysical()
160160161161 // TODO: Coregister front & back?
162162- // TODO: Handle no back
163162164163 frontPoints, err := images.Outline(pc.Front, false, true)
165164 if err != nil {
···167166 }
168167 fTris := geom3d.Triangulate(frontPoints)
169168169169+ // TODO: Handle no back
170170 backPoints, err := images.Outline(pc.Back, true, true)
171171 if err != nil {
172172 return fmt.Errorf("back image can't be outlined: %w", err)
+2
formats/web/codec.go
···5757 "jpeg": {},
5858 "webp": {lossless: true, transparency: true},
5959 "png": {lossless: true, transparency: true},
6060+ "svg": {transparency: true},
6061}
61626263// Only returns true if the capabilities on struct owning this method meet the needs of the provided capabilities object.
···7879}
79808081var DefaultCodec, _ = Codec("jpeg", "webp")
8282+var SVGCodec, _ = Codec("svg")
81838284func (c codec) Name() string { return codecName }