exif

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package exif reads the EXIF metadata block out of a JPEG.

Parse walks the JPEG markers to the EXIF segment and decodes its TIFF structure into a TagStore, which preserves the order tags were found in and keeps the first value seen for a repeated tag. The parser matches the npm exif-parser library, including its use of exceptions for control flow, mirrored here as a scoped panic/recover that Parse converts to an error.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValueString

func ValueString(v any) string

ValueString renders a simplified tag value the way JS string interpolation does (numbers via JS Number formatting, arrays joined by ",").

Types

type TagStore

type TagStore struct {
	Order []string
	// contains filtered or unexported fields
}

TagStore preserves tag insertion order with first-value-wins semantics.

func Parse

func Parse(data []byte) (store *TagStore, err error)

Parse parses all EXIF tags from a JPEG/TIFF byte stream.

func (*TagStore) Get

func (s *TagStore) Get(name string) (any, bool)

Get returns the value stored under name, and whether it is present.

Jump to

Keyboard shortcuts

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