imageresize

package
v0.82.2 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertImageBytesToPNG added in v0.82.0

func ConvertImageBytesToPNG(data []byte) ([]byte, bool)

func FormatDimensionNote

func FormatDimensionNote(result ResizedImage) string

func ImageEXIFOrientation

func ImageEXIFOrientation(bytes []byte) int

Types

type ConvertedImage

type ConvertedImage struct {
	Data     string
	MIMEType string
}

func ConvertToPNG

func ConvertToPNG(base64Data, mimeType string) *ConvertedImage

type ImageResizeOptions

type ImageResizeOptions struct {
	MaxWidth    int
	MaxHeight   int
	MaxBytes    int
	JPEGQuality int
}

type ProcessImageOptions added in v0.82.0

type ProcessImageOptions struct {
	AutoResizeImages *bool
	ResizeOptions    ImageResizeOptions
	ResizeImage      func([]byte, string, ImageResizeOptions) *ResizedImage
}

type ProcessImageResult added in v0.82.0

type ProcessImageResult struct {
	OK       bool
	Data     string
	MIMEType string
	Hints    []string
	Message  string
}

func ProcessImage added in v0.82.0

func ProcessImage(data []byte, mimeType string, options ...ProcessImageOptions) ProcessImageResult

type ResizedImage

type ResizedImage struct {
	Data           string
	MIMEType       string
	OriginalWidth  int
	OriginalHeight int
	Width          int
	Height         int
	WasResized     bool
}

func ResizeImage

func ResizeImage(part llm.ContentPart, options ...ImageResizeOptions) *ResizedImage

func ResizeImageBytes added in v0.82.0

func ResizeImageBytes(inputBytes []byte, mimeType string, options ...ImageResizeOptions) *ResizedImage

Jump to

Keyboard shortcuts

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