feat(don): automatically downscale images
Build and Push Image / build-backend (push) Successful in 2m33s
Build and Push Image / build-frontend (push) Successful in 4m32s
Build and Push Image / push (push) Successful in 9m16s

This commit is contained in:
2026-06-29 11:36:50 +07:00 Unverified
parent 599e95c934
commit 6d85f74c48
3 changed files with 12 additions and 10 deletions
+8 -1
View File
@@ -191,13 +191,20 @@ export default async function () {
const { name, amount, message, image } = $;
const downscaled = image
? await new Bun.Image(await image.arrayBuffer())
.resize(512, 512)
.webp()
.toBuffer()
: undefined;
const [{ id }] = await tx
.insert(donations)
.values({
name,
amount,
message,
image: image ? Buffer.from(await image.arrayBuffer()) : undefined,
image: downscaled,
uid: $.artifact === "true" ? $.uid : null,
// dont send on screen if less than 10
sent: $.amount < 10,
+3 -7
View File
@@ -43,7 +43,7 @@
"@sfjs/snowflake": "^0.1.5",
"@tanstack/react-table": "^8.21.3",
"@tanstack/react-virtual": "^3.14.2",
"@types/bun": "^1.3.12",
"@types/bun": "^1.3.14",
"auto-text-size": "^0.2.3",
"babel-plugin-react-compiler": "^1.0.0",
"better-auth": "^1.4.6",
@@ -64,7 +64,6 @@
"radix-ui": "^1.4.3",
"react": "19.2.6",
"react-day-picker": "^9.12.0",
"react-document-picture-in-picture": "^1.2.2",
"react-dom": "19.2.6",
"react-hook-form": "^7.68.0",
"react-hook-text-overflow": "^1.0.1",
@@ -111,7 +110,6 @@
],
"patchedDependencies": {
"[email protected]": "patches/[email protected]",
"[email protected]": "patches/[email protected]",
},
"overrides": {
"@types/react": "19.2.14",
@@ -729,7 +727,7 @@
"@tanstack/virtual-core": ["@tanstack/[email protected]", "", {}, "sha512-gOxY/hFkPh/XQYhnThBHzkbkX3Ed+z/iushyz+R+JAr213aXxUDgQoTgTdrDpBSRsjFM73P/KfUyWmaF9WHMkQ=="],
"@types/bun": ["@types/[email protected]2", "", { "dependencies": { "bun-types": "1.3.12" } }, "sha512-DBv81elK+/VSwXHDlnH3Qduw+KxkTIWi7TXkAeh24zpi5l0B2kUg9Ga3tb4nJaPcOFswflgi/yAvMVBPrxMB+A=="],
"@types/bun": ["@types/[email protected]4", "", { "dependencies": { "bun-types": "1.3.14" } }, "sha512-h1hFqFVcvAvD9j9K7ZW7vd82aSA+rTdznZa+5bwvCwqSB1jmmfLcbIWhOLx1/+boy/xmjgCs/OMUL8hRJSmnPw=="],
"@types/d3-array": ["@types/[email protected]", "", {}, "sha512-hOLWVbm7uRza0BYXpIIW5pxfrKe0W+D5lrFiAEYR+pb6w3N2SwSMaJbXdUfSEv+dT4MfHBLtn5js0LAWaO6otw=="],
@@ -803,7 +801,7 @@
"buffer-from": ["[email protected]", "", {}, "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="],
"bun-types": ["[email protected]2", "", { "dependencies": { "@types/node": "*" } }, "sha512-HqOLj5PoFajAQciOMRiIZGNoKxDJSr6qigAttOX40vJuSp6DN/CxWp9s3C1Xwm4oH7ybueITwiaOcWXoYVoRkA=="],
"bun-types": ["[email protected]4", "", { "dependencies": { "@types/node": "*" } }, "sha512-4N0ig0fEomHt5R0KCFWjovxow98rIoRwKolrYdCcknNwMekCXRnWEUvgu5soYV8QXtVsrUD8B95MBOZGPvr6KQ=="],
"bundle-name": ["[email protected]", "", { "dependencies": { "run-applescript": "^7.0.0" } }, "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q=="],
@@ -1173,8 +1171,6 @@
"react-day-picker": ["[email protected]", "", { "dependencies": { "@date-fns/tz": "^1.4.1", "date-fns": "^4.1.0", "date-fns-jalali": "^4.1.0-0" }, "peerDependencies": { "react": ">=16.8.0" } }, "sha512-euzj5Hlq+lOHqI53NiuNhCP8HWgsPf/bBAVijR50hNaY1XwjKjShAnIe8jm8RD2W9IJUvihDIZ+KrmqfFzNhFQ=="],
"react-document-picture-in-picture": ["[email protected]", "", { "peerDependencies": { "react": "^18.2.0", "react-dom": "^18.2.0" } }, "sha512-MqwBF4gL56qe8QoFGu/Cc2QxplZcCMK125gMqcGvQQm8xL3z1iiGPTUE2Fk7Ct6IEvmuYtsupsdIwCNl2i16aQ=="],
"react-dom": ["[email protected]", "", { "dependencies": { "scheduler": "^0.27.0" }, "peerDependencies": { "react": "^19.2.6" } }, "sha512-0prMI+hvBbPjsWnxDLxlCGyM8PN6UuWjEUCYmZhO67xIV9Xasa/r/vDnq+Xyq4Lo27g8QSbO5YzARu0D1Sps3g=="],
"react-hook-form": ["[email protected]", "", { "peerDependencies": { "react": "^16.8.0 || ^17 || ^18 || ^19" } }, "sha512-9SUJKCGKo8HUSsCO+y0CtqkqI5nNuaDqTxyqPsZPqIwudpj4rCrAz/jZV+jn57bx5gtZKOh3neQu94DXMc+w5w=="],
+1 -2
View File
@@ -57,7 +57,7 @@
"@sfjs/snowflake": "^0.1.5",
"@tanstack/react-table": "^8.21.3",
"@tanstack/react-virtual": "^3.14.2",
"@types/bun": "^1.3.12",
"@types/bun": "^1.3.14",
"auto-text-size": "^0.2.3",
"babel-plugin-react-compiler": "^1.0.0",
"better-auth": "^1.4.6",
@@ -78,7 +78,6 @@
"radix-ui": "^1.4.3",
"react": "19.2.6",
"react-day-picker": "^9.12.0",
"react-document-picture-in-picture": "^1.2.2",
"react-dom": "19.2.6",
"react-hook-form": "^7.68.0",
"react-hook-text-overflow": "^1.0.1",