package exif

import "github.com/gohugoio/hugo/resources/images/exif"

Index

Functions

func ExcludeFields

func ExcludeFields(expression string) func(*Decoder) error

func IncludeFields

func IncludeFields(expression string) func(*Decoder) error

func WithDateDisabled

func WithDateDisabled(disabled bool) func(*Decoder) error

func WithLatLongDisabled

func WithLatLongDisabled(disabled bool) func(*Decoder) error

func WithWarnLogger

func WithWarnLogger(warnl logg.LevelLogger) func(*Decoder) error

Types

type Decoder

type Decoder struct {
	// contains filtered or unexported fields
}

func NewDecoder

func NewDecoder(options ...func(*Decoder) error) (*Decoder, error)

func (*Decoder) Decode

func (d *Decoder) Decode(filename string, format imagemeta.ImageFormat, r io.Reader) (ex *ExifInfo, err error)

Filename is only used for logging.

type ExifInfo

type ExifInfo struct {
	// GPS latitude in degrees.
	Lat float64

	// GPS longitude in degrees.
	Long float64

	// Image creation date/time.
	Date time.Time

	// A collection of the available Exif tags for this Image.
	Tags Tags
}

ExifInfo holds the decoded Exif data for an Image.

type Tags

type Tags map[string]any

Tags is a map of EXIF tags.

func (Tags) MarshalJSON

func (v Tags) MarshalJSON() ([]byte, error)

MarshalJSON is for internal use only.

func (*Tags) UnmarshalJSON

func (v *Tags) UnmarshalJSON(b []byte) error

UnmarshalJSON is for internal use only.

Source Files

exif.go

Version
v0.144.2 (latest)
Published
Feb 19, 2025
Platform
linux/amd64
Imports
9 packages
Last checked
13 hours ago

Tools for package owners.