Compare commits
No commits in common. "c74b314b1e580a72f2b4c57fccc935e634a483a7" and "8e293c204d7bd1336515a118519c042e53022787" have entirely different histories.
c74b314b1e
...
8e293c204d
14
.github/workflows/default.yaml
vendored
14
.github/workflows/default.yaml
vendored
@ -51,9 +51,21 @@ 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: |
|
||||
pnpm i && pnpm build
|
||||
# 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
|
||||
|
||||
- name: 🔑 Configure rclone
|
||||
run: |
|
||||
|
1036
src/helpers/exif_
Normal file
1036
src/helpers/exif_
Normal file
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: ImageMetadata) {
|
||||
export async function generateThumbHash(image: { width: number, height: number }) {
|
||||
|
||||
const sharp = await getSharp();
|
||||
if (!sharp) return;
|
||||
@ -20,6 +20,7 @@ export async function generateThumbHash(image: ImageMetadata) {
|
||||
const smallHeight = Math.floor(image.height * scaleFactor);
|
||||
|
||||
try {
|
||||
|
||||
//@ts-ignore
|
||||
const smallImg = await sharp(image.fsPath)
|
||||
.resize(smallWidth, smallHeight)
|
||||
@ -31,8 +32,7 @@ export async function generateThumbHash(image: ImageMetadata) {
|
||||
const buffer = rgbaToThumbHash(smallWidth, smallHeight, smallImg);
|
||||
return Buffer.from(buffer).toString("base64");
|
||||
} catch (error) {
|
||||
//@ts-ignore
|
||||
console.log(`Could not generate thumbhash for ${image.fsPath}`, error)
|
||||
console.log("Could not generate thumbhash", error)
|
||||
return undefined
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user