Compare commits
2 Commits
8e293c204d
...
c74b314b1e
Author | SHA1 | Date | |
---|---|---|---|
|
c74b314b1e | ||
|
50ce8b3ff7 |
14
.github/workflows/default.yaml
vendored
14
.github/workflows/default.yaml
vendored
@ -51,21 +51,9 @@ jobs:
|
||||
- name: 🔄 Pull Git LFS files
|
||||
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
|
||||
run: |
|
||||
# Build with NODE_OPTIONS to increase memory limits and avoid watching files
|
||||
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
|
||||
pnpm i && pnpm build
|
||||
|
||||
- name: 🔑 Configure rclone
|
||||
run: |
|
||||
|
1036
src/helpers/exif_
1036
src/helpers/exif_
File diff suppressed because it is too large
Load Diff
@ -9,7 +9,7 @@ async function getSharp(): Promise<typeof import("sharp") | undefined> {
|
||||
return s;
|
||||
}
|
||||
|
||||
export async function generateThumbHash(image: { width: number, height: number }) {
|
||||
export async function generateThumbHash(image: ImageMetadata) {
|
||||
|
||||
const sharp = await getSharp();
|
||||
if (!sharp) return;
|
||||
@ -20,7 +20,6 @@ export async function generateThumbHash(image: { width: number, height: number }
|
||||
const smallHeight = Math.floor(image.height * scaleFactor);
|
||||
|
||||
try {
|
||||
|
||||
//@ts-ignore
|
||||
const smallImg = await sharp(image.fsPath)
|
||||
.resize(smallWidth, smallHeight)
|
||||
@ -32,7 +31,8 @@ export async function generateThumbHash(image: { width: number, height: number }
|
||||
const buffer = rgbaToThumbHash(smallWidth, smallHeight, smallImg);
|
||||
return Buffer.from(buffer).toString("base64");
|
||||
} catch (error) {
|
||||
console.log("Could not generate thumbhash", error)
|
||||
//@ts-ignore
|
||||
console.log(`Could not generate thumbhash for ${image.fsPath}`, error)
|
||||
return undefined
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user