feat(bskyweb): regen icon+logo from Bluesky butterfly, drop strip composite
@@ -12,7 +12,6 @@ import (
|
|||||||
_ "image/png"
|
_ "image/png"
|
||||||
"io"
|
"io"
|
||||||
"io/fs"
|
"io/fs"
|
||||||
"log/slog"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
@@ -199,19 +198,17 @@ func (srv *Server) buildPassAssets(theme, handle string, avatarBytes []byte) ([]
|
|||||||
logo2, _ := readFS(srv.cfg.InvitePass.StripFS, "passes/logo@2x.png")
|
logo2, _ := readFS(srv.cfg.InvitePass.StripFS, "passes/logo@2x.png")
|
||||||
logo3, _ := readFS(srv.cfg.InvitePass.StripFS, "passes/logo@3x.png")
|
logo3, _ := readFS(srv.cfg.InvitePass.StripFS, "passes/logo@3x.png")
|
||||||
|
|
||||||
avatarImg, _ := decodeImage(avatarBytes)
|
// Strip is just the per-theme gradient PNG, served as-is. The pass's
|
||||||
strip1Bytes, err := buildStripAtDensity(srv.cfg.InvitePass.StripFS, theme, 1, avatarImg, handle, srv.cfg.InvitePass.FontFace)
|
// storeCard primaryFields render the handle below the strip, so painting
|
||||||
|
// it again on the image would be redundant. avatarBytes is currently
|
||||||
|
// unused; reserved for a future composite that draws the user's avatar.
|
||||||
|
_ = avatarBytes
|
||||||
|
strip1Bytes, err := readFS(srv.cfg.InvitePass.StripFS, "passes/strip-"+theme+".png")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("strip@1x: %w", err)
|
return nil, fmt.Errorf("strip@1x: %w", err)
|
||||||
}
|
}
|
||||||
strip2Bytes, err := buildStripAtDensity(srv.cfg.InvitePass.StripFS, theme, 2, avatarImg, handle, srv.cfg.InvitePass.FontFace)
|
strip2Bytes, _ := readFS(srv.cfg.InvitePass.StripFS, "passes/strip-"+theme+"@2x.png")
|
||||||
if err != nil {
|
strip3Bytes, _ := readFS(srv.cfg.InvitePass.StripFS, "passes/strip-"+theme+"@3x.png")
|
||||||
slog.Debug("invite pass: strip composite failed", "scale", 2, "err", err)
|
|
||||||
}
|
|
||||||
strip3Bytes, err := buildStripAtDensity(srv.cfg.InvitePass.StripFS, theme, 3, avatarImg, handle, srv.cfg.InvitePass.FontFace)
|
|
||||||
if err != nil {
|
|
||||||
slog.Debug("invite pass: strip composite failed", "scale", 3, "err", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
assets := []PassAsset{
|
assets := []PassAsset{
|
||||||
{Name: "icon.png", Data: icon1},
|
{Name: "icon.png", Data: icon1},
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 102 B After Width: | Height: | Size: 570 B |
|
Before Width: | Height: | Size: 152 B After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 235 B After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 102 B After Width: | Height: | Size: 580 B |
|
Before Width: | Height: | Size: 152 B After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 235 B After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 102 B After Width: | Height: | Size: 705 B |
|
Before Width: | Height: | Size: 153 B After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 236 B After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 207 B After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 382 B After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 619 B After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 102 B After Width: | Height: | Size: 716 B |
|
Before Width: | Height: | Size: 153 B After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 235 B After Width: | Height: | Size: 2.2 KiB |