(width: number, height: number)
| 20 | const MAX_IMAGE_READ_BYTES = 5 * 1024 * 1024 |
| 21 | |
| 22 | async function makeNoisePng(width: number, height: number): Promise<Buffer> { |
| 23 | const sharp = (await import('sharp')).default |
| 24 | const raw = Buffer.alloc(width * height * 3) |
| 25 | randomFillSync(raw) |
| 26 | return sharp(raw, { raw: { width, height, channels: 3 } }) |
| 27 | .png() |
| 28 | .toBuffer() |
| 29 | } |
| 30 | |
| 31 | const SHARP_TEST_TIMEOUT_MS = 30_000 |
| 32 |
no test coverage detected