Fix harmonize:images thumb rebuild and allow oversized museum scans.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Danila Khodjaef
2026-07-27 12:23:25 +03:00
co-authored by Cursor
parent 6656f91f25
commit 89e39d408a
8 changed files with 92 additions and 13 deletions
+7 -1
View File
@@ -1691,7 +1691,13 @@ async function generateThumbnailFromFull(fullDest, thumbDest, width = THUMB_WIDT
if (!fs.existsSync(fullDest)) return false;
const ext = path.extname(thumbDest).toLowerCase();
let pipeline = sharp(fullDest).rotate().resize({ width, withoutEnlargement: true });
// Museum scans can exceed Sharp's default ~268MP input cap; we only resize down.
let pipeline = sharp(fullDest, {
limitInputPixels: false,
sequentialRead: true,
})
.rotate()
.resize({ width, withoutEnlargement: true });
if (ext === '.png') {
pipeline = pipeline.png({ quality: 85 });