Documentation
¶
Overview ¶
Package image provides image loading, validation, and encoding utilities.
Index ¶
Constants ¶
View Source
const (
// MaxImageSize is the maximum allowed image size (5MB)
MaxImageSize = 5 * 1024 * 1024
)
Variables ¶
View Source
var SupportedTypes = map[string]string{
".png": "image/png",
".jpg": "image/jpeg",
".jpeg": "image/jpeg",
".webp": "image/webp",
".gif": "image/gif",
}
SupportedTypes maps file extensions to MIME types
Functions ¶
func FormatBytes ¶
FormatBytes formats byte size as human-readable string
func IsImageFile ¶
IsImageFile returns true if the file extension indicates a supported image format
func ReadImageToProviderData ¶
ReadImageToProviderData reads clipboard image directly to provider.ImageData
Types ¶
type ImageInfo ¶
ImageInfo holds information about a loaded image
func ReadImageFromClipboard ¶
ReadImageFromClipboard reads an image from the clipboard. Returns nil, nil if no image is available (not an error).
func (*ImageInfo) ToProviderData ¶
ToProviderData converts ImageInfo to provider.ImageData
Click to show internal directories.
Click to hide internal directories.