image

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImageTransformer

type ImageTransformer struct {
	// contains filtered or unexported fields
}

ImageTransformer transforms image data for display in terminals It implements io.Reader and handles format conversion: - PNG: passes through with base64url -> base64 translation - JPEG/GIF/etc: decodes -> encodes to PNG -> base64

func NewImageTransformer

func NewImageTransformer(
	base64urlData string,
	contentType string,
) (*ImageTransformer, int, int, error)

NewImageTransformer creates a new image transformer base64urlData is the base64url-encoded image data from Gmail contentType is the MIME type (e.g., "image/png", "image/jpeg") Returns the transformer and the image dimensions (width, height)

func (*ImageTransformer) Close

func (t *ImageTransformer) Close() error

Close cleans up resources, particularly stopping the background goroutine for non-PNG image conversions. It's safe to call multiple times.

func (*ImageTransformer) Read

func (t *ImageTransformer) Read(p []byte) (n int, err error)

Read implements io.Reader

Jump to

Keyboard shortcuts

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