imageinput

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package imageinput handles image input from clipboard paste and file drag-drop, converting raw data to agentcore ContentBlocks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromBytes

func FromBytes(data []byte) (agentcore.ContentBlock, error)

FromBytes validates raw image data and returns an ImageBlock. Checks size limit and MIME type.

func LoadFile

func LoadFile(path string) (agentcore.ContentBlock, error)

LoadFile reads an image file and returns a validated ContentBlock.

func ParseDroppedPath

func ParseDroppedPath(text string) string

ParseDroppedPath extracts an image file path from bracketed-paste text. Handles terminal drag-drop formats: quoted, backslash-escaped, raw. Returns "" if the text is not an image file path.

func ReadImage

func ReadImage() ([]byte, error)

ReadImage attempts to read image data from the system clipboard. Returns PNG-encoded bytes on success. Returns (nil, nil) when the clipboard contains no image.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL