Help us shape the future of Go! Take the 2026 Go Developer Survey

imaging

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package imaging reads bounded image metadata, never pixel buffers or networks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PositiveAttribute

func PositiveAttribute(value string) int

PositiveAttribute deliberately rejects zero, signed/relative/malformed values. Their presence is author intent; inference must never repair or replace them.

Types

type Decision

type Decision struct {
	Info
	Added                         []string `json:"added,omitempty"`
	Reason                        string   `json:"reason"`
	Candidates                    []Info   `json:"candidates,omitempty"`
	AuthoredWidth, AuthoredHeight int      `json:"-"`
	CompareSize                   bool     `json:"-"`
}

Decision corresponds to one HTML img in document order. It carries source attribution through URL packing into the exact-final-byte validation stage.

type Info

type Info struct {
	Source  string `json:"source"`
	Format  string `json:"format,omitempty"`
	Width   int    `json:"intrinsicWidth,omitempty"`
	Height  int    `json:"intrinsicHeight,omitempty"`
	Bytes   int    `json:"bytes,omitempty"`
	Raster  bool   `json:"raster,omitempty"`
	Issue   string `json:"issue,omitempty"`
	Unknown string `json:"unknown,omitempty"`
}

Info contains metadata dimensions. Unknown/Issue makes them unsuitable for inferred layout, but known pixel counts still support absolute asset budgets.

func Inspect

func Inspect(raw []byte) (info Info)

Jump to

Keyboard shortcuts

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