From 1819abb982fb3199910294de6afa2d9ebc3754f8 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Fri, 2 Jan 2026 00:57:24 +0000 Subject: feat(svg): Pre-encoding Base64 strings --- src/cache.gleam | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/cache.gleam') diff --git a/src/cache.gleam b/src/cache.gleam index 13c3b05..ccba2a8 100644 --- a/src/cache.gleam +++ b/src/cache.gleam @@ -1,3 +1,4 @@ +import gleam/bit_array import gleam/dict.{type Dict} import gleam/int import gleam/list @@ -8,7 +9,7 @@ import simplifile import wisp pub type CachedImage { - CachedImage(data: BitArray, info: image.ImageInformation) + CachedImage(base64: String, info: image.ImageInformation) } pub type ThemeCache = @@ -49,7 +50,10 @@ pub fn load_themes() { dict.insert( accumulated_digits, digit, - CachedImage(data: image_data, info: info), + CachedImage( + base64: bit_array.base64_encode(image_data, False), + info: info, + ), ) Error(_) -> { wisp.log_error( -- cgit v1.2.3