Documentation
¶
Overview ¶
Package imageprep validates and normalizes raster images before they enter provider-independent model content.
Index ¶
Constants ¶
View Source
const ( DefaultMaxInputBytes int64 = 10 << 20 DefaultMaxPixels int64 = 40_000_000 DefaultMaxDimension = 2048 DefaultMaxOutputBytes int64 = 10 << 20 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorCode ¶
type ErrorCode string
ErrorCode is a stable machine-readable preparation failure category.
const ( ErrorInvalid ErrorCode = "image_invalid" ErrorUnsupported ErrorCode = "image_unsupported" ErrorTypeMismatch ErrorCode = "image_type_mismatch" ErrorTooLarge ErrorCode = "image_too_large" ErrorTooManyPixels ErrorCode = "image_too_many_pixels" ErrorAnimated ErrorCode = "image_animated" ErrorCancelled ErrorCode = "image_cancelled" )
type Policy ¶
Policy bounds source decoding and normalized model content.
func DefaultPolicy ¶
func DefaultPolicy() Policy
DefaultPolicy returns the common policy for current coding image sources.
type Prepared ¶
type Prepared struct {
Content llm.ImageContent
Bytes int
OriginalWidth int
OriginalHeight int
OutputWidth int
OutputHeight int
Resized bool
Reencoded bool
}
Prepared contains canonical model content and inspectable transformation facts. Raw bytes are represented only by Content.Data so metadata and logs do not accidentally duplicate the image payload.
Click to show internal directories.
Click to hide internal directories.