image

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package image provides bounded standard-library raster image ingestion.

Index

Constants

View Source
const MaxPixels = 16 * 1024 * 1024

MaxPixels caps decoded pixel count, preventing unexpectedly large allocations.

Variables

View Source
var ErrSize = errors.New("image: invalid or excessive dimensions")

Functions

func Decode

func Decode(data []byte) (image.Image, error)

Decode accepts only PNG or JPEG bytes and checks dimensions before allocating pixels. The caller bounds the input byte slice before reading it from an untrusted stream.

func Size

func Size(src image.Image) (width, height int, err error)

Size validates dimensions of an already decoded image. Its owner retains the image.

Types

This section is empty.

Jump to

Keyboard shortcuts

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