imagetool

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadImageTool added in v0.3.0

func ReadImageTool() spec.Tool

Types

type ReadImageArgs added in v0.3.0

type ReadImageArgs struct {
	Path              string `json:"path"`
	IncludeBase64Data bool   `json:"includeBase64Data"`
}

type ReadImageOut added in v0.3.0

type ReadImageOut struct {
	Path      string     `json:"path"`
	Name      string     `json:"name"`
	Exists    bool       `json:"exists"`
	SizeBytes int64      `json:"sizeBytes,omitempty"`
	ModTime   *time.Time `json:"modTime,omitempty"`

	Width    int    `json:"width,omitempty"`
	Height   int    `json:"height,omitempty"`
	Format   string `json:"format,omitempty"`   // "png", "jpeg", ...
	MIMEType string `json:"mimeType,omitempty"` // "image/png", ...

	// Optional content.
	Base64Data string `json:"base64Data,omitempty"`
}

func ReadImage added in v0.3.0

func ReadImage(ctx context.Context, args ReadImageArgs) (*ReadImageOut, error)

ReadImage reads intrinsic metadata for a local image file, optionally including base64-encoded contents. Semantics:

  • empty path => error
  • directory path => error
  • non-image/unsupported image => error
  • non-existent path => (Exists=false, err=nil).

Jump to

Keyboard shortcuts

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