Documentation
¶
Overview ¶
Package heic implements an HEIC image decoder based on the pure-Rust heic crate compiled to WASM (run via wazero, or transpiled with the wasm2go build tag), or libheif/libde265 via a dynamic library.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrMemRead = errors.New("heic: mem read failed") ErrMemWrite = errors.New("heic: mem write failed") ErrDecode = errors.New("heic: decode failed") )
Errors .
var ErrNoExif = errors.New("heic: no exif data")
ErrNoExif is returned by DecodeExif when the HEIC image has no EXIF metadata.
var ForceWasmMode bool
ForceWasmMode, if true, forces using the WASM-based decoder even if a dynamic/shared library is available.
This exists mainly for testing purposes.
It is not safe to change this concurrently with any other use of this package.
Functions ¶
func DecodeConfig ¶
DecodeConfig returns the color model and dimensions of a HEIC image without decoding the entire image.
Types ¶
type Exif ¶ added in v0.6.1
type Exif struct {
// Basic image info
Orientation int // EXIF orientation (1-8). 1 = normal, values 2-8 indicate rotation/flip.
Width int // Image width in pixels.
Height int // Image height in pixels.
// Camera info
Make string // Camera manufacturer (e.g., "Canon").
Model string // Camera model (e.g., "Canon EOS 5D Mark III").
Software string // Software used to process/create the image.
// Date/Time (format: "YYYY:MM:DD HH:MM:SS")
DateTime string // File modification date/time.
DateTimeOriginal string // Original capture date/time (when photo was taken).
// Exposure settings
ExposureTime float64 // Shutter speed in seconds (e.g., 0.004 = 1/250s).
FNumber float64 // Aperture f-number (e.g., 5.6 = f/5.6).
ISOSpeed int // ISO speed rating (e.g., 800).
FocalLength float64 // Lens focal length in millimeters.
Flash int // Flash mode/status (0 = no flash, non-zero = flash fired).
// GPS location
GPSLatitude float64 // Latitude in decimal degrees (positive = North, negative = South).
GPSLongitude float64 // Longitude in decimal degrees (positive = East, negative = West).
GPSAltitude float64 // Altitude in meters above sea level.
// Copyright/Author
Copyright string // Copyright notice.
Artist string // Creator/photographer name.
}
Exif holds the EXIF metadata decoded from a HEIC image.