mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-23 12:46:56 +00:00
perf(transcode): optimize PDF page rendering pipeline using in-memory sharp buffers
This commit is contained in:
@@ -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 {}
|
||||
|
||||
Reference in New Issue
Block a user