switched from s3 to disk for saving icons

This commit is contained in:
Joe Lothan 2026-05-18 12:43:50 -04:00
parent 113a261dae
commit 5b3f6a6870
9 changed files with 84 additions and 112 deletions

View file

@ -2,7 +2,6 @@ package main
import (
"bytes"
"context"
"encoding/base64"
"fmt"
"image"
@ -14,11 +13,11 @@ import (
_ "golang.org/x/image/webp"
)
// convertIconToBase64PNG downloads an icon from S3, converts it to PNG, and returns base64-encoded data.
func convertIconToBase64PNG(ctx context.Context, s3Key string, iconsBucket string) (encoded string, width, height int, err error) {
data, err := s3Download(ctx, iconsBucket, s3Key)
// convertIconToBase64PNG reads an icon from disk, converts it to PNG, and returns base64-encoded data.
func convertIconToBase64PNG(hash string, iconsDir string) (encoded string, width, height int, err error) {
data, err := readIconFromDisk(iconsDir, hash)
if err != nil {
return "", 0, 0, fmt.Errorf("s3 download: %w", err)
return "", 0, 0, fmt.Errorf("read icon: %w", err)
}
// Check for SVG (can't decode to raster without external deps)