jpegtest

package
v0.96.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package jpegtest builds hostile JPEG fixtures for the tests of the framework's image-adjacent packages (framework/image and framework/file). Tests only: nothing outside a _test.go file imports it, so it never links into a binary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Progressive

func Progressive(w, h, comps, scans int) []byte

Progressive returns a valid progressive JPEG of w×h pixels with comps components (1 or 3, each sampled 1×1) and scans AC scans, each the ScanBomb scan over one component in turn. A few hundred bytes buy the decoder's whole-frame coefficient buffer: image/jpeg keeps 256 bytes per block of every component a scan names, so a 3-component 8192×8192 frame allocates 768 MB of coefficients before its pixels.

func ScanBomb

func ScanBomb(w, h, scans int) []byte

ScanBomb returns a valid grayscale progressive JPEG of w×h pixels made of scans copies of one AC scan. Each scan is a single end-of-band run code repeated to cover every block, so it costs about ten bytes per 330,000 blocks while the decoder walks every block of the frame again: decode CPU grows with scans × pixels and the file with scans alone. w and h must each fit in 16 bits.

Types

This section is empty.

Jump to

Keyboard shortcuts

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