perf(transcode): optimize PDF page rendering pipeline using in-memory sharp buffers

This commit is contained in:
yiling
2026-07-19 10:18:50 +08:00
parent 6064a1449a
commit e2523e1a81
2 changed files with 11 additions and 16 deletions
@@ -25,6 +25,8 @@ vi.mock('sharp', () => {
const mockSharp = {
resize: vi.fn().mockReturnThis(),
webp: vi.fn().mockReturnThis(),
composite: vi.fn().mockReturnThis(),
toBuffer: vi.fn().mockResolvedValue(Buffer.from('fake-webp-buffer')),
toFile: vi.fn().mockImplementation(async (filePath: string) => {
fs.writeFileSync(filePath, 'fake-webp-data')
return {}