Documentation
¶
Overview ¶
Package terminalimage writes native images, image fonts, or color-block previews.
Index ¶
- Variables
- func FontSupported() bool
- func ReadSaved(ctx context.Context, path string) (image.Image, error)
- func ReadSavedMatching(ctx context.Context, path string, expected [sha256.Size]byte) (image.Image, error)
- func Write(ctx context.Context, w io.Writer, img image.Image, protocol string, ...) error
- type FontError
Constants ¶
This section is empty.
Variables ¶
var ErrSavedImageChanged = errors.New("saved image contents changed before preview")
ErrSavedImageChanged means the preview bytes differ from the completed save.
Functions ¶
func FontSupported ¶
func FontSupported() bool
FontSupported identifies a local Apple Terminal session. Font registration and tab control must never target a remote shell or a terminal multiplexer.
func ReadSaved ¶
ReadSaved decodes an optional preview. These limits protect terminal rendering; they never limit the API response or change the original saved image.
func ReadSavedMatching ¶
func ReadSavedMatching(ctx context.Context, path string, expected [sha256.Size]byte) (image.Image, error)
ReadSavedMatching previews only the response bytes recorded by a prior save. Both identity checks and decoding apply to the same bounded snapshot, so a replaced path or a rewritten open file cannot substitute another image.