fix: handle base64 uploads correctly #64

Merged
naomi merged 8 commits from fix/urls into main 2026-02-20 16:53:48 -08:00
Showing only changes of commit 7e47e87d85 - Show all commits
+1 -1
View File
@@ -48,7 +48,7 @@ export class BookService {
if (data.coverImage) { if (data.coverImage) {
if (data.coverImage.startsWith("data:")) { if (data.coverImage.startsWith("data:")) {
const sizeInBytes = data.coverImage.length * 0.75; const sizeInBytes = data.coverImage.length * 0.75;
if (sizeInBytes > MAX_LENGTHS.IMAGE_DATA) { if (sizeInBytes > MAX_LENGTHS.DATA_URL) {
throw new Error("Cover image must be under 5MB."); throw new Error("Cover image must be under 5MB.");
} }
if (!validateDataUrl(data.coverImage)) { if (!validateDataUrl(data.coverImage)) {