imageutil

package
v0.0.0-...-a19470a Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PrepareOptions

type PrepareOptions struct {
	MaxBytes         int
	MaxDimension     int
	MaxDownloadBytes int
	MinDimension     int
	ScaleStep        float64
	JPEGQualities    []int
	HTTPClient       *http.Client
}

type PreparedImage

type PreparedImage struct {
	Data                []byte
	MIMEType            string
	OriginalBytes       int
	FinalBytes          int
	OriginalWidth       int
	OriginalHeight      int
	FinalWidth          int
	FinalHeight         int
	OriginalContentType string
	Reencoded           bool
}

func PrepareImageBytes

func PrepareImageBytes(data []byte, contentType string, options PrepareOptions) (*PreparedImage, error)

func PrepareImageForService

func PrepareImageForService(ctx context.Context, imageURL string, options PrepareOptions) (*PreparedImage, error)

func (*PreparedImage) DataURL

func (p *PreparedImage) DataURL() string

Jump to

Keyboard shortcuts

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