fix: address open triage issues (#21,#26,#45,#46,#47,#30-33)
CI / skip-ci-check (pull_request) Successful in 6s
CI / docker-ci (pull_request) Successful in 7s
CI / secret-scan (pull_request) Successful in 11s

- #45: re-read local folder when recursive checkbox toggles
- #47: clear Identify crop spinner when image is already cached
- #46: search selected people by person_ids; AND for "First Last"
- #21: enqueue network import without blocking API walk
- #26: serve resized grid thumbnails for photos
- #30/#31/#33: re-enable small-face filters in auto-match
This commit is contained in:
2026-07-09 14:42:08 -04:00
parent d69ad1576d
commit ffddeca268
10 changed files with 218 additions and 94 deletions
@@ -260,6 +260,38 @@ export async function GET(
},
});
// Grid thumbnails: resize photos (videos handled above) — #26
if (thumbnail && sharp) {
try {
let pipeline = sharp(imageBuffer).rotate().resize({
width: 480,
height: 480,
fit: 'inside',
withoutEnlargement: true,
});
if (watermark) {
const metadata = await pipeline.metadata();
const baseWidth = metadata.width ?? 480;
const baseHeight = metadata.height ?? 480;
const overlayBuffer = await getWatermarkOverlay(baseWidth, baseHeight);
pipeline = sharp(imageBuffer)
.rotate()
.resize({ width: 480, height: 480, fit: 'inside', withoutEnlargement: true })
.composite([{ input: overlayBuffer, gravity: 'center', blend: 'hard-light' }]);
}
const result = await pipeline.jpeg({ quality: 75 }).toBuffer();
return new NextResponse(result as unknown as BodyInit, {
headers: {
'Content-Type': 'image/jpeg',
'Cache-Control': 'public, max-age=86400',
},
});
} catch (error) {
console.error('Error generating image thumbnail:', error);
// fall through to original / watermarked full image
}
}
if (!watermark) {
return createOriginalResponse();
}