Documentation
¶
Index ¶
Constants ¶
View Source
const MaxSize = 20 * 1024 * 1024
MaxSize is the maximum allowed image size (20MB).
Variables ¶
View Source
var ( MIMEJPEG = "image/jpeg" MIMEPNG = "image/png" MIMEGIF = "image/gif" MIMEWEBP = "image/webp" )
Supported MIME types.
Functions ¶
func DetectMIME ¶
DetectMIME detects image MIME type from magic bytes.
func EncodeBase64 ¶
EncodeBase64 returns the base64-encoded representation of image data.
func IsImageFile ¶
IsImageFile checks if a file path looks like an image based on extension.
func Placeholder ¶
Placeholder returns a TUI-friendly placeholder string for an image.
Types ¶
type Image ¶
type Image struct {
Data []byte
MIME string // "image/png", "image/jpeg", etc.
Width int
Height int
}
Image represents a decoded image ready for sending to providers.
func Decode ¶
Decode decodes raw image data, detecting MIME type and dimensions. Returns an error if data exceeds MaxSize or format is unsupported.
func ReadClipboard ¶
Click to show internal directories.
Click to hide internal directories.