Compare commits

...

2 Commits

Author SHA1 Message Date
Max Richter
c74b314b1e feat: cleanup some stuff
All checks were successful
Deploy to SFTP Server / build (push) Successful in 4m14s
2025-05-14 19:42:28 +02:00
Max Richter
50ce8b3ff7 feat: log imagePath when failed to generate Thumbhash 2025-05-14 19:37:24 +02:00
3 changed files with 4 additions and 1052 deletions

View File

@ -51,21 +51,9 @@ jobs:
- name: 🔄 Pull Git LFS files - name: 🔄 Pull Git LFS files
run: git lfs pull run: git lfs pull
- name: 🔧 Increase file descriptor limits
run: |
echo "Current file descriptor limits:"
ulimit -n
echo "Increasing file descriptor limits..."
ulimit -n 65536
echo "New file descriptor limits:"
ulimit -n
- name: 🏗️ Build site - name: 🏗️ Build site
run: | run: |
# Build with NODE_OPTIONS to increase memory limits and avoid watching files pnpm i && pnpm build
export NODE_OPTIONS="--max-old-space-size=4096 --no-warnings"
# Astro-specific optimizations to avoid file watching
pnpm i && NODE_ENV=production ASTRO_DISABLE_HMR=true pnpm build
- name: 🔑 Configure rclone - name: 🔑 Configure rclone
run: | run: |

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,7 @@ async function getSharp(): Promise<typeof import("sharp") | undefined> {
return s; return s;
} }
export async function generateThumbHash(image: { width: number, height: number }) { export async function generateThumbHash(image: ImageMetadata) {
const sharp = await getSharp(); const sharp = await getSharp();
if (!sharp) return; if (!sharp) return;
@ -20,7 +20,6 @@ export async function generateThumbHash(image: { width: number, height: number }
const smallHeight = Math.floor(image.height * scaleFactor); const smallHeight = Math.floor(image.height * scaleFactor);
try { try {
//@ts-ignore //@ts-ignore
const smallImg = await sharp(image.fsPath) const smallImg = await sharp(image.fsPath)
.resize(smallWidth, smallHeight) .resize(smallWidth, smallHeight)
@ -32,7 +31,8 @@ export async function generateThumbHash(image: { width: number, height: number }
const buffer = rgbaToThumbHash(smallWidth, smallHeight, smallImg); const buffer = rgbaToThumbHash(smallWidth, smallHeight, smallImg);
return Buffer.from(buffer).toString("base64"); return Buffer.from(buffer).toString("base64");
} catch (error) { } catch (error) {
console.log("Could not generate thumbhash", error) //@ts-ignore
console.log(`Could not generate thumbhash for ${image.fsPath}`, error)
return undefined return undefined
} }