MCPcopy Create free account
hub / github.com/modelcontextprotocol/mcpb / isPNG

Function isPNG

src/node/validate.ts:18–31  ·  view source on GitHub ↗

* Check if a buffer contains a valid PNG file signature

(buffer: Buffer)

Source from the content-addressed store, hash-verified

16 * Check if a buffer contains a valid PNG file signature
17 */
18function isPNG(buffer: Buffer): boolean {
19 // PNG signature: 89 50 4E 47 0D 0A 1A 0A
20 return (
21 buffer.length >= 8 &&
22 buffer[0] === 0x89 &&
23 buffer[1] === 0x50 &&
24 buffer[2] === 0x4e &&
25 buffer[3] === 0x47 &&
26 buffer[4] === 0x0d &&
27 buffer[5] === 0x0a &&
28 buffer[6] === 0x1a &&
29 buffer[7] === 0x0a
30 );
31}
32
33/**
34 * Validate icon field in manifest

Callers 1

validateIconFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…