Fix detail stitch long preview format
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled

This commit is contained in:
Your Name 2026-05-14 15:48:48 +08:00
parent a3a41ef6e6
commit 5f90dbde67

View File

@ -126,7 +126,7 @@ function buildReferenceFetchUrl(url: string): string {
return buildImageProxyUrl(url, { return buildImageProxyUrl(url, {
width: PREVIEW_MAX_WIDTH, width: PREVIEW_MAX_WIDTH,
quality: 82, quality: 82,
format: "webp", format: "jpeg",
}); });
} }
@ -303,14 +303,15 @@ async function prepareStitch(params: {
}, },
}) })
.composite(compositeItems) .composite(compositeItems)
.webp({ .jpeg({
quality: 76, quality: 76,
effort: 4, mozjpeg: true,
progressive: true,
}) })
.toBuffer(); .toBuffer();
const upload = await uploadFile( const upload = await uploadFile(
`detail-stitch-preview-${Date.now()}-${Math.random().toString(36).slice(2, 8)}.webp`, `detail-stitch-preview-${Date.now()}-${Math.random().toString(36).slice(2, 8)}.jpg`,
bufferToArrayBuffer(previewBuffer), bufferToArrayBuffer(previewBuffer),
); );