imageproc

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDimensionsTooLarge = errors.New("image dimensions exceed maximum of 10000px")
	ErrUnsupportedFormat  = errors.New("unsupported image format")
	ErrDecodeFailed       = errors.New("failed to decode image")
	ErrEncodeFailed       = errors.New("failed to encode image")
)

Functions

This section is empty.

Types

type SanitizeResult

type SanitizeResult struct {
	Data        []byte
	ContentType string
}

func SanitizeImage

func SanitizeImage(data []byte, declaredContentType string) (*SanitizeResult, error)

SanitizeImage re-encodes an image to strip any non-image payloads and validates that its dimensions do not exceed the maximum allowed size.

Jump to

Keyboard shortcuts

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