MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / hasImageWindows

Function hasImageWindows

cli/src/utils/clipboard-image.ts:215–230  ·  view source on GitHub ↗

* Check if clipboard contains an image (Windows)

()

Source from the content-addressed store, hash-verified

213 * Check if clipboard contains an image (Windows)
214 */
215function hasImageWindows(): boolean {
216 try {
217 const script = `
218 Add-Type -AssemblyName System.Windows.Forms
219 if ([System.Windows.Forms.Clipboard]::ContainsImage()) { Write-Output "true" } else { Write-Output "false" }
220 `
221 const result = spawnSync('powershell', ['-STA', '-Command', script], {
222 encoding: 'utf-8',
223 timeout: 5000,
224 })
225
226 return result.stdout?.trim() === 'true'
227 } catch {
228 return false
229 }
230}
231
232/**
233 * Read image from clipboard (Windows)

Callers 1

hasClipboardImageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected