Documentation
¶
Overview ¶
Package clipboardimage reads a picture from the system clipboard for chat's Alt+V paste (image input design 0.3). Every platform keeps its own reader in a build-tagged file; the common piece dispatches and carries the test hook the ptysmoke scripts use. The bytes go straight into the view_image pipeline (validation, scaling, encoding) — nothing here decodes them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoClipboardImage = errors.New("剪贴板里没有图片")
ErrNoClipboardImage is what a reader returns when this process could see a clipboard but no picture is on it (chat shows it verbatim).
Functions ¶
This section is empty.
Types ¶
type ImageReader ¶
ImageReader reads one picture from the clipboard: its bytes (any format the view_image pipeline accepts, PNG preferred), a name to report and an error. A clipboard without a picture comes back as ErrNoClipboardImage.
func Reader ¶
func Reader(tr i18n.Translator) ImageReader
Reader returns this platform's reader; with the fake clipboard named in the environment it returns a file reader instead, so the smoke tests the whole Alt+V flow without a real clipboard. maxClipboardBytes bounds what a reader may hand back. tr is the host UI catalog of the platform hints (the name the picture is reported under, the reasons a read fails).