MCPcopy
hub / github.com/simstudioai/sim / makeNoisePng

Function makeNoisePng

apps/sim/lib/copilot/vfs/file-reader.test.ts:22–29  ·  view source on GitHub ↗
(width: number, height: number)

Source from the content-addressed store, hash-verified

20const MAX_IMAGE_READ_BYTES = 5 * 1024 * 1024
21
22async 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
31const SHARP_TEST_TIMEOUT_MS = 30_000
32

Callers 1

Calls 1

toBufferMethod · 0.45

Tested by

no test coverage detected