imx

package module
v0.0.0-...-ddbbca1 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: MIT Imports: 20 Imported by: 0

Image README

imx

Go Reference CI codecov Go Report Card Image

Fast, dependency-free metadata extraction for images, audio, and video files in Go.

Features

  • Zero dependencies - Pure Go, stdlib only, no CGO
  • 20+ formats - JPEG, PNG, GIF, WebP, TIFF, HEIC, CR2, DNG, NEF, ARW, ORF, RAF, RW2, PEF, SRW, 3FR, MP3, FLAC, MP4, M4A
  • Multiple metadata types - EXIF, IPTC, XMP, ICC profiles, ID3 tags, FLAC metadata
  • Streaming I/O - Memory efficient using io.ReaderAt, never loads entire files
  • Safety limits - Configurable max-bytes (default 50MB) and buffering controls to prevent unbounded reads
  • Well-tested - Extensive unit, fuzz, and benchmark coverage across parsers
  • Thread-safe - Stateless parsers safe for concurrent use

Installation

go get github.com/gomantics/imx
CLI Tool
go install github.com/gomantics/imx/cmd/imx@latest

Quick Start

package main

import (
    "fmt"
    "log"

    "github.com/gomantics/imx"
)

func main() {
    // Extract metadata from a file
    meta, err := imx.MetadataFromFile("photo.jpg")
    if err != nil {
        log.Fatal(err)
    }

    // Access common EXIF tags using constants
    if tag, ok := meta.Tag(imx.TagMake); ok {
        fmt.Printf("Camera: %v\n", tag.Value)
    }
    if tag, ok := meta.Tag(imx.TagModel); ok {
        fmt.Printf("Model: %v\n", tag.Value)
    }
    if tag, ok := meta.Tag(imx.TagDateTimeOriginal); ok {
        fmt.Printf("Date: %v\n", tag.Value)
    }
}

API Overview

Convenience Functions
// From file path
meta, err := imx.MetadataFromFile("photo.jpg")

// From io.Reader
meta, err := imx.MetadataFromReader(reader)

// From byte slice
meta, err := imx.MetadataFromBytes(data)

// From URL
meta, err := imx.MetadataFromURL("https://example.com/photo.jpg")

// With options
meta, err := imx.MetadataFromFile("photo.jpg",
    imx.WithMaxBytes(5<<20),     // Limit total bytes (default 50MB)
    imx.WithBufferSize(64*1024), // 64KB buffer (default)
)
// Exceeding MaxBytes returns imx.ErrMaxBytesExceeded
Using the Extractor
extractor := imx.New(
    imx.WithMaxBytes(10<<20),              // Limit to 10MB
    imx.WithBufferSize(128*1024),          // 128KB buffer
    imx.WithHTTPTimeout(30*time.Second),   // HTTP timeout for URLs
)

meta, err := extractor.MetadataFromFile("photo.jpg")
// Default safety: 50MB max bytes; configurable via WithMaxBytes
Iterating Tags
// Iterate all tags
meta.Each(func(dir imx.Directory, tag imx.Tag) bool {
    fmt.Printf("%s:%s = %v\n", dir.Name, tag.Name, tag.Value)
    return true // continue iteration
})

// Iterate tags in a specific directory
meta.EachInDirectory("IFD0", func(tag imx.Tag) bool {
    fmt.Printf("%s = %v\n", tag.Name, tag.Value)
    return true
})
Batch Retrieval
// Get multiple tags at once
values := meta.GetAll(imx.TagMake, imx.TagModel, imx.TagISO)
for id, value := range values {
    fmt.Printf("%s: %v\n", id, value)
}

Supported Metadata

Type Description
EXIF Camera settings, GPS coordinates, timestamps, device information
IPTC News and media metadata including captions, credits, keywords
XMP Adobe's XML-based extensible metadata
ICC Color profile data for accurate color reproduction
ID3 Audio metadata for MP3 files (v2.2, v2.3, v2.4)
FLAC Metadata StreamInfo, Vorbis Comments, Pictures, and other blocks

Supported Formats

Images
  • JPEG (.jpg, .jpeg) – EXIF, IPTC, XMP, ICC
  • PNG (.png) – Text chunks, EXIF, XMP, ICC
  • GIF (.gif) – Comments, XMP, NETSCAPE extension
  • WebP (.webp) – EXIF, XMP, ICC
  • TIFF (.tiff, .tif) – IFD-based metadata
  • HEIC/HEIF (.heic, .heif, .hif) – EXIF, XMP, ICC
RAW Formats
  • CR2 (.cr2) – Canon RAW
  • DNG (.dng) – Adobe Digital Negative
  • NEF (.nef) – Nikon RAW
  • ARW (.arw) – Sony RAW
  • ORF (.orf) – Olympus RAW
  • RAF (.raf) – Fujifilm RAW
  • RW2 (.rw2) – Panasonic RAW
  • PEF (.pef) – Pentax RAW
  • SRW (.srw) – Samsung RAW
  • 3FR (.3fr) – Hasselblad RAW
  • Most TIFF-based RAW formats
Audio/Video
  • MP3 (.mp3) – ID3v2.2, v2.3, v2.4 tags
  • FLAC (.flac) – All metadata blocks
  • MP4 (.mp4, .m4v) – iTunes metadata, EXIF
  • M4A (.m4a) – AAC audio container

CLI Usage

# Basic extraction
imx photo.jpg

# JSON output
imx --format json photo.jpg

# CSV output
imx --format csv photo.jpg

# Filter by directory
imx --dir IFD0 photo.jpg

# Get specific tag
imx --tag Make photo.jpg

# Process multiple files
imx --recursive ./photos/

# Read from stdin
cat photo.jpg | imx

# Process audio files
imx song.mp3
imx audio.flac

# Process video files
imx video.mp4

Benchmarks

Benchmarks depend on hardware and Go version. Run them locally to establish your own baselines:

make bench

The suite covers high-level APIs and all parsers; see Makefile for options.

Latest local run (darwin/arm64, Go 1.25, benchtime=2s):

High-Level API
BenchmarkMetadataFromFile-12        310715 ns/op   280028 B/op    2879 allocs/op
BenchmarkMetadataFromBytes-12       173898 ns/op   279574 B/op    2875 allocs/op
BenchmarkMetadataFromReader-12      191216 ns/op   425643 B/op    3105 allocs/op
BenchmarkMetadata_Tag-12                 11.10 ns/op        0 B/op       0 allocs/op
BenchmarkMetadata_GetAll-12              68.25 ns/op       48 B/op       1 allocs/op
BenchmarkMetadata_Each-12                69.36 ns/op        0 B/op       0 allocs/op

Parser Benchmarks
PNG     309 ns/op     1152 B/op     16 allocs/op
IPTC    2382 ns/op    6968 B/op    111 allocs/op
WebP    2285 ns/op    4082 B/op    133 allocs/op
ICC     2483 ns/op    8213 B/op    134 allocs/op
TIFF    2524 ns/op    4010 B/op    147 allocs/op
FLAC    2917 ns/op    9742 B/op    120 allocs/op
MP4     12576 ns/op   46324 B/op   258 allocs/op
ID3     15263 ns/op   78209 B/op   207 allocs/op
XMP     20479 ns/op   24456 B/op   373 allocs/op
GIF     41003 ns/op   160609 B/op  272 allocs/op
JPEG    42684 ns/op   45150 B/op   774 allocs/op
HEIC    57765 ns/op   87397 B/op   1822 allocs/op
CR2     69119 ns/op   114971 B/op  889 allocs/op

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for development guidelines.

License

MIT License - see LICENSE for details.

Image Documentation

Overview

Package imx provides fast, dependency-free extraction of image metadata.

It supports EXIF, IPTC, XMP, and ICC metadata from JPEG, PNG, GIF, WebP, TIFF-based formats (including CR2/DNG), HEIC, plus ID3/FLAC/MP4 audio/video tags.

Version: 1.0.0

Basic usage:

meta, err := imx.MetadataFromFile("photo.jpg")
if err != nil {
	log.Fatal(err)
}

// Access tags by ID
if tag, ok := meta.Tag("EXIF:IFD0:Make"); ok {
	fmt.Printf("Camera: %v\n", tag.Value)
}

// Or use type-safe getters
make, err := meta.GetString("EXIF:IFD0:Make")
if err == nil {
	fmt.Printf("Camera: %s\n", make)
}

For more control, use the Extractor type:

extractor := imx.New(
	imx.WithHTTPTimeout(60 * time.Second), // Set HTTP timeout for URL fetching
)

meta, err := extractor.MetadataFromFile("photo.jpg")

Iterate over tags:

// All tags across all directories
meta.Each(func(dir imx.Directory, tag imx.Tag) bool {
	fmt.Printf("[%s] %s = %v\n", dir.Name, tag.Name, tag.Value)
	return true // continue
})

// Tags in a specific directory
meta.EachInDirectory("IFD0", func(tag imx.Tag) bool {
	fmt.Printf("%s = %v\n", tag.Name, tag.Value)
	return true
})

Error handling:

meta, err := imx.MetadataFromFile("photo.jpg")
if err != nil {
	if errors.Is(err, imx.ErrUnknownFormat) {
		fmt.Println("Unsupported file format")
	} else {
		log.Fatal(err)
	}
}

// Check for parsing errors
if len(meta.Errors()) > 0 {
	fmt.Printf("Parsing errors: %v\n", meta.Errors())
	// meta still contains successfully parsed data
}

Multiple input sources:

// From file with safety limit
meta, err := imx.MetadataFromFile("photo.jpg", imx.WithMaxBytes(50<<20))

// From byte slice
data, _ := os.ReadFile("photo.jpg")
meta, err = imx.MetadataFromBytes(data)

// From io.Reader (buffered on-demand)
file, _ := os.Open("photo.jpg")
meta, err = imx.MetadataFromReader(file)

// From URL
meta, err = imx.MetadataFromURL("https://example.com/photo.jpg")

Index

Constants

View Source
const Version = "1.0.0"

Version is the semantic version of the imx package

Variables

View Source
var ErrMaxBytesExceeded = errors.New("imx: max bytes exceeded")

ErrMaxBytesExceeded is returned when reading beyond the configured MaxBytes limit.

View Source
var ErrUnknownFormat = errors.New("imx: unknown format")

ErrUnknownFormat is returned when the file format is not recognized

Functions

This section is empty.

Types

type Directory

type Directory = parser.Directory

Re-export parser types as the public API types

type Extractor

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

Extractor is a reusable metadata extractor, safe for concurrent use

func New

func New(opts ...Option) *Extractor

New creates a new Extractor with the given options

func (*Extractor) MetadataFromBytes

func (e *Extractor) MetadataFromBytes(data []byte, opts ...Option) (*Metadata, error)

MetadataFromBytes extracts metadata from a byte slice

func (*Extractor) MetadataFromFile

func (e *Extractor) MetadataFromFile(path string, opts ...Option) (*Metadata, error)

MetadataFromFile extracts metadata from a file path

func (*Extractor) MetadataFromReader

func (e *Extractor) MetadataFromReader(r io.Reader, opts ...Option) (*Metadata, error)

MetadataFromReader extracts metadata from an io.Reader using a smart buffering adapter. This adapter implements io.ReaderAt by buffering data as it's read, avoiding the need to load the entire stream into memory upfront.

func (*Extractor) MetadataFromURL

func (e *Extractor) MetadataFromURL(url string, opts ...Option) (*Metadata, error)

MetadataFromURL extracts metadata from an HTTP/HTTPS URL

type Metadata

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

Metadata is the top-level container for all parsed metadata. Fields are unexported to prevent external mutation; use accessor methods instead.

func MetadataFromBytes

func MetadataFromBytes(data []byte, opts ...Option) (*Metadata, error)

MetadataFromBytes extracts metadata from a byte slice using the default extractor.

The opts parameter accepts functional options to customize extraction behavior. Currently available options:

  • WithHTTPTimeout: Has no effect for byte operations (only applies to MetadataFromURL)

The opts parameter is provided for API consistency and forward compatibility with future configuration options.

func MetadataFromFile

func MetadataFromFile(path string, opts ...Option) (*Metadata, error)

MetadataFromFile extracts metadata from a file path using the default extractor.

The opts parameter accepts functional options to customize extraction behavior. Currently available options:

  • WithHTTPTimeout: Has no effect for file operations (only applies to MetadataFromURL)

The opts parameter is provided for API consistency and forward compatibility with future configuration options.

func MetadataFromReader

func MetadataFromReader(r io.Reader, opts ...Option) (*Metadata, error)

MetadataFromReader extracts metadata from an io.Reader using the default extractor. This buffers data on-demand using a smart adapter that implements io.ReaderAt.

The opts parameter accepts functional options to customize extraction behavior. Currently available options:

  • WithHTTPTimeout: Has no effect for reader operations (only applies to MetadataFromURL)

The opts parameter is provided for API consistency and forward compatibility with future configuration options.

func MetadataFromURL

func MetadataFromURL(url string, opts ...Option) (*Metadata, error)

MetadataFromURL extracts metadata from an HTTP/HTTPS URL using the default extractor.

The opts parameter accepts functional options to customize extraction behavior. Available options:

  • WithHTTPTimeout: Sets the HTTP request timeout (default: 30 seconds)

Example:

meta, err := imx.MetadataFromURL("https://example.com/photo.jpg",
	imx.WithHTTPTimeout(60 * time.Second))

func (*Metadata) AllTags

func (m *Metadata) AllTags() []Tag

AllTags returns a flat slice of all tags across all directories. The order matches the iteration order (directory order, then tag order within each directory).

func (*Metadata) Directories

func (m *Metadata) Directories() []Directory

Directories returns a slice of all parsed metadata directories. The returned slice is a copy to prevent external modification.

func (*Metadata) Directory

func (m *Metadata) Directory(name string) (Directory, bool)

Directory returns the directory with the given name

func (*Metadata) DirectoryNames

func (m *Metadata) DirectoryNames() []string

DirectoryNames returns a list of all directory names present in the metadata.

func (*Metadata) Each

func (m *Metadata) Each(fn func(Directory, Tag) bool)

Each iterates over all tags, calling fn for each tag. If fn returns false, iteration stops.

func (*Metadata) EachInDirectory

func (m *Metadata) EachInDirectory(name string, fn func(Tag) bool)

EachInDirectory iterates over tags in the given directory. If fn returns false, iteration stops.

func (*Metadata) EachTag

func (m *Metadata) EachTag(fn func(Tag) bool)

EachTag iterates over all tags across all directories. If fn returns false, iteration stops.

func (*Metadata) Errors

func (m *Metadata) Errors() []error

Errors returns a slice of all errors encountered during parsing. The returned slice is a copy to prevent external modification.

func (*Metadata) GetAll

func (m *Metadata) GetAll(ids ...TagID) map[TagID]any

GetAll returns a map of values for the given tag IDs

func (*Metadata) GetBytes

func (m *Metadata) GetBytes(id TagID) ([]byte, error)

GetBytes returns the tag value as a byte slice. Returns an error if the tag doesn't exist or is not a byte slice or string.

func (*Metadata) GetFloat

func (m *Metadata) GetFloat(id TagID) (float64, error)

GetFloat returns the tag value as a float64. Returns an error if the tag doesn't exist or cannot be converted to float64.

func (*Metadata) GetInt

func (m *Metadata) GetInt(id TagID) (int64, error)

GetInt returns the tag value as an int64. Returns an error if the tag doesn't exist or cannot be converted to int64.

func (*Metadata) GetString

func (m *Metadata) GetString(id TagID) (string, error)

GetString returns the tag value as a string.

Conversion rules:

  • string: returned as-is
  • []byte: converted to string
  • fmt.Stringer: calls String() method
  • all other types: converted using fmt.Sprintf("%v", value)

The fallback conversion allows numeric types (int, float, etc.) commonly found in metadata to be displayed as strings. For type-safe numeric conversions, use GetInt or GetFloat instead.

Returns an error only if the tag doesn't exist.

func (*Metadata) MarshalJSON

func (m *Metadata) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler for Metadata. The JSON structure is:

{
  "directories": [...],
  "errors": [...]
}

func (*Metadata) Tag

func (m *Metadata) Tag(id TagID) (Tag, bool)

Tag returns the tag with the given ID using an efficient index. The index is built lazily on first call and cached for subsequent calls.

func (*Metadata) TagCount

func (m *Metadata) TagCount() int

TagCount returns the total number of tags across all directories.

type Option

type Option func(*config)

Option is a functional option for configuring an Extractor

func WithBufferSize

func WithBufferSize(n int) Option

WithBufferSize sets the streaming read buffer size used for reader/URL inputs. A value of 0 falls back to the default buffer size.

func WithHTTPTimeout

func WithHTTPTimeout(d time.Duration) Option

WithHTTPTimeout sets the HTTP request timeout for URL fetching. The timeout applies only to MetadataFromURL operations.

Panics if d is negative. A timeout of 0 means no timeout (unlimited).

func WithMaxBytes

func WithMaxBytes(n int64) Option

WithMaxBytes sets an upper bound on the total bytes that can be read from any source (file, reader, or URL). A value of 0 means no limit.

type Tag

type Tag = parser.Tag

Re-export parser types as the public API types

type TagID

type TagID = parser.TagID

Re-export parser types as the public API types

const (
	TagMake         TagID = "EXIF:Make"
	TagModel        TagID = "EXIF:Model"
	TagSoftware     TagID = "EXIF:Software"
	TagOrientation  TagID = "EXIF:Orientation"
	TagSerialNumber TagID = "EXIF:SerialNumber"
	TagOwnerName    TagID = "EXIF:OwnerName"
)

Camera and Device Tags

const (
	TagLensMake         TagID = "EXIF:LensMake"
	TagLensModel        TagID = "EXIF:LensModel"
	TagLensSerialNumber TagID = "EXIF:LensSerialNumber"
	TagLensInfo         TagID = "EXIF:LensInfo"
)

Lens Tags

const (
	TagImageDescription TagID = "EXIF:ImageDescription"
	TagImageTitle       TagID = "EXIF:ImageTitle"
	TagArtist           TagID = "EXIF:Artist"
	TagPhotographer     TagID = "EXIF:Photographer"
	TagCopyright        TagID = "EXIF:Copyright"
	TagUserComment      TagID = "EXIF:UserComment"
)

Image Description Tags

const (
	TagDateTimeOriginal    TagID = "EXIF:DateTimeOriginal"
	TagCreateDate          TagID = "EXIF:CreateDate"
	TagModifyDate          TagID = "EXIF:ModifyDate"
	TagOffsetTime          TagID = "EXIF:OffsetTime"
	TagOffsetTimeOriginal  TagID = "EXIF:OffsetTimeOriginal"
	TagSubSecTime          TagID = "EXIF:SubSecTime"
	TagSubSecTimeOriginal  TagID = "EXIF:SubSecTimeOriginal"
	TagSubSecTimeDigitized TagID = "EXIF:SubSecTimeDigitized"
)

Date and Time Tags

const (
	TagImageWidth      TagID = "EXIF:ImageWidth"
	TagImageHeight     TagID = "EXIF:ImageHeight"
	TagExifImageWidth  TagID = "EXIF:ExifImageWidth"
	TagExifImageHeight TagID = "EXIF:ExifImageHeight"
)

Image Dimensions Tags

const (
	TagExposureTime         TagID = "EXIF:ExposureTime"
	TagShutterSpeedValue    TagID = "EXIF:ShutterSpeedValue"
	TagFNumber              TagID = "EXIF:FNumber"
	TagApertureValue        TagID = "EXIF:ApertureValue"
	TagExposureProgram      TagID = "EXIF:ExposureProgram"
	TagExposureMode         TagID = "EXIF:ExposureMode"
	TagExposureCompensation TagID = "EXIF:ExposureCompensation"
	TagBrightnessValue      TagID = "EXIF:BrightnessValue"
)

Exposure Tags

const (
	TagISO                       TagID = "EXIF:ISO"
	TagISOSpeed                  TagID = "EXIF:ISOSpeed"
	TagSensitivityType           TagID = "EXIF:SensitivityType"
	TagStandardOutputSensitivity TagID = "EXIF:StandardOutputSensitivity"
	TagRecommendedExposureIndex  TagID = "EXIF:RecommendedExposureIndex"
)

ISO Tags

const (
	TagFocalLength             TagID = "EXIF:FocalLength"
	TagFocalLengthIn35mmFormat TagID = "EXIF:FocalLengthIn35mmFormat"
	TagMaxApertureValue        TagID = "EXIF:MaxApertureValue"
	TagSubjectDistance         TagID = "EXIF:SubjectDistance"
	TagSubjectDistanceRange    TagID = "EXIF:SubjectDistanceRange"
)

Focus and Lens Settings Tags

const (
	TagFlash       TagID = "EXIF:Flash"
	TagFlashEnergy TagID = "EXIF:FlashEnergy"
)

Flash Tags

const (
	TagMeteringMode TagID = "EXIF:MeteringMode"
	TagLightSource  TagID = "EXIF:LightSource"
	TagWhiteBalance TagID = "EXIF:WhiteBalance"
)

Metering and Lighting Tags

const (
	TagColorSpace       TagID = "EXIF:ColorSpace"
	TagContrast         TagID = "EXIF:Contrast"
	TagSaturation       TagID = "EXIF:Saturation"
	TagSharpness        TagID = "EXIF:Sharpness"
	TagDigitalZoomRatio TagID = "EXIF:DigitalZoomRatio"
)

Image Quality Tags

const (
	TagSceneCaptureType TagID = "EXIF:SceneCaptureType"
	TagSceneType        TagID = "EXIF:SceneType"
)

Scene Tags

const (
	TagGPSVersionID         TagID = "EXIF:GPSVersionID"
	TagGPSLatitudeRef       TagID = "EXIF:GPSLatitudeRef"
	TagGPSLatitude          TagID = "EXIF:GPSLatitude"
	TagGPSLongitudeRef      TagID = "EXIF:GPSLongitudeRef"
	TagGPSLongitude         TagID = "EXIF:GPSLongitude"
	TagGPSAltitudeRef       TagID = "EXIF:GPSAltitudeRef"
	TagGPSAltitude          TagID = "EXIF:GPSAltitude"
	TagGPSTimeStamp         TagID = "EXIF:GPSTimeStamp"
	TagGPSDateStamp         TagID = "EXIF:GPSDateStamp"
	TagGPSSatellites        TagID = "EXIF:GPSSatellites"
	TagGPSStatus            TagID = "EXIF:GPSStatus"
	TagGPSMeasureMode       TagID = "EXIF:GPSMeasureMode"
	TagGPSDOP               TagID = "EXIF:GPSDOP"
	TagGPSSpeed             TagID = "EXIF:GPSSpeed"
	TagGPSSpeedRef          TagID = "EXIF:GPSSpeedRef"
	TagGPSTrack             TagID = "EXIF:GPSTrack"
	TagGPSTrackRef          TagID = "EXIF:GPSTrackRef"
	TagGPSImgDirection      TagID = "EXIF:GPSImgDirection"
	TagGPSImgDirectionRef   TagID = "EXIF:GPSImgDirectionRef"
	TagGPSMapDatum          TagID = "EXIF:GPSMapDatum"
	TagGPSDestLatitude      TagID = "EXIF:GPSDestLatitude"
	TagGPSDestLatitudeRef   TagID = "EXIF:GPSDestLatitudeRef"
	TagGPSDestLongitude     TagID = "EXIF:GPSDestLongitude"
	TagGPSDestLongitudeRef  TagID = "EXIF:GPSDestLongitudeRef"
	TagGPSDestBearing       TagID = "EXIF:GPSDestBearing"
	TagGPSDestBearingRef    TagID = "EXIF:GPSDestBearingRef"
	TagGPSDestDistance      TagID = "EXIF:GPSDestDistance"
	TagGPSDestDistanceRef   TagID = "EXIF:GPSDestDistanceRef"
	TagGPSProcessingMethod  TagID = "EXIF:GPSProcessingMethod"
	TagGPSAreaInformation   TagID = "EXIF:GPSAreaInformation"
	TagGPSDifferential      TagID = "EXIF:GPSDifferential"
	TagGPSHPositioningError TagID = "EXIF:GPSHPositioningError"
)

GPS Tags

const (
	TagExifVersion     TagID = "EXIF:ExifVersion"
	TagFlashpixVersion TagID = "EXIF:FlashpixVersion"
)

Version Tags

const (
	TagCompression               TagID = "EXIF:Compression"
	TagPhotometricInterpretation TagID = "EXIF:PhotometricInterpretation"
	TagXResolution               TagID = "EXIF:XResolution"
	TagYResolution               TagID = "EXIF:YResolution"
	TagResolutionUnit            TagID = "EXIF:ResolutionUnit"
	TagYCbCrPositioning          TagID = "EXIF:YCbCrPositioning"
	TagRating                    TagID = "EXIF:Rating"
	TagRatingPercent             TagID = "EXIF:RatingPercent"
)

Other Common Tags

const (
	TagIPTCObjectName             TagID = "IPTC:ObjectName"             // Title/shorthand reference
	TagIPTCUrgency                TagID = "IPTC:Urgency"                // 1=most urgent, 8=least
	TagIPTCCategory               TagID = "IPTC:Category"               // Subject category code
	TagIPTCSupplementalCategories TagID = "IPTC:SupplementalCategories" // Additional categories
	TagIPTCKeywords               TagID = "IPTC:Keywords"               // Keywords for indexing
	TagIPTCFixtureIdentifier      TagID = "IPTC:FixtureIdentifier"      // Identifies recurring events
	TagIPTCEditStatus             TagID = "IPTC:EditStatus"             // Status of object
	TagIPTCSpecialInstructions    TagID = "IPTC:SpecialInstructions"    // Special instructions
	TagIPTCSubjectReference       TagID = "IPTC:SubjectReference"       // Structured subject reference
)

IPTC Core Identification Tags

const (
	TagIPTCDateCreated         TagID = "IPTC:DateCreated"         // Intellectual content created
	TagIPTCTimeCreated         TagID = "IPTC:TimeCreated"         // Time content created
	TagIPTCDigitalCreationDate TagID = "IPTC:DigitalCreationDate" // Digital file created
	TagIPTCDigitalCreationTime TagID = "IPTC:DigitalCreationTime" // Digital file time
	TagIPTCReleaseDate         TagID = "IPTC:ReleaseDate"         // Earliest release date
	TagIPTCReleaseTime         TagID = "IPTC:ReleaseTime"         // Earliest release time
	TagIPTCExpirationDate      TagID = "IPTC:ExpirationDate"      // Latest use date
	TagIPTCExpirationTime      TagID = "IPTC:ExpirationTime"      // Latest use time
)

IPTC Date/Time Tags

const (
	TagIPTCByline          TagID = "IPTC:Byline"          // Creator/author name
	TagIPTCBylineTitle     TagID = "IPTC:BylineTitle"     // Creator's title/position
	TagIPTCCredit          TagID = "IPTC:Credit"          // Provider credit line
	TagIPTCSource          TagID = "IPTC:Source"          // Original owner/creator
	TagIPTCCopyrightNotice TagID = "IPTC:CopyrightNotice" // Copyright notice
	TagIPTCContact         TagID = "IPTC:Contact"         // Contact information
	TagIPTCWriterEditor    TagID = "IPTC:Writer-Editor"   // Caption writer name
)

IPTC Creator/Author Tags

const (
	TagIPTCCity                TagID = "IPTC:City"                        // City of origin
	TagIPTCSublocation         TagID = "IPTC:Sublocation"                 // Location within city
	TagIPTCProvinceState       TagID = "IPTC:Province-State"              // Province/State of origin
	TagIPTCCountryCode         TagID = "IPTC:Country-PrimaryLocationCode" // ISO 3166 country code
	TagIPTCCountryName         TagID = "IPTC:Country-PrimaryLocationName" // Full country name
	TagIPTCContentLocationCode TagID = "IPTC:ContentLocationCode"         // Content location code
	TagIPTCContentLocationName TagID = "IPTC:ContentLocationName"         // Content location name
)

IPTC Location Tags

const (
	TagIPTCHeadline                      TagID = "IPTC:Headline"                      // Publishable headline
	TagIPTCCaptionAbstract               TagID = "IPTC:Caption-Abstract"              // Description/caption
	TagIPTCOriginatingProgram            TagID = "IPTC:OriginatingProgram"            // Program that created file
	TagIPTCProgramVersion                TagID = "IPTC:ProgramVersion"                // Version of program
	TagIPTCOriginalTransmissionReference TagID = "IPTC:OriginalTransmissionReference" // Original reference/job ID
)

IPTC Description Tags

const (
	TagXMPTitle       TagID = "XMP-dc:title"       // Title of the work
	TagXMPCreator     TagID = "XMP-dc:creator"     // Creator/author
	TagXMPDescription TagID = "XMP-dc:description" // Description/caption
	TagXMPSubject     TagID = "XMP-dc:subject"     // Keywords/subjects
	TagXMPRights      TagID = "XMP-dc:rights"      // Copyright/rights info
	TagXMPDate        TagID = "XMP-dc:date"        // Date
	TagXMPFormat      TagID = "XMP-dc:format"      // MIME type
	TagXMPIdentifier  TagID = "XMP-dc:identifier"  // Unique identifier
	TagXMPLanguage    TagID = "XMP-dc:language"    // Language
	TagXMPPublisher   TagID = "XMP-dc:publisher"   // Publisher
	TagXMPRelation    TagID = "XMP-dc:relation"    // Related resources
	TagXMPSource      TagID = "XMP-dc:source"      // Source
	TagXMPType        TagID = "XMP-dc:type"        // Type/genre
)

XMP Dublin Core (dc) Tags

const (
	TagXMPCreateDate   TagID = "XMP-xmp:CreateDate"   // Date created
	TagXMPModifyDate   TagID = "XMP-xmp:ModifyDate"   // Date modified
	TagXMPMetadataDate TagID = "XMP-xmp:MetadataDate" // Metadata last modified
	TagXMPCreatorTool  TagID = "XMP-xmp:CreatorTool"  // Application that created file
	TagXMPRating       TagID = "XMP-xmp:Rating"       // User rating (0-5)
	TagXMPLabel        TagID = "XMP-xmp:Label"        // Color label
	TagXMPBaseURL      TagID = "XMP-xmp:BaseURL"      // Base URL for relative URLs
)

XMP Basic (xmp) Tags

const (
	TagXMPCertificate  TagID = "XMP-xmpRights:Certificate"  // Rights certificate
	TagXMPMarked       TagID = "XMP-xmpRights:Marked"       // Copyright marked
	TagXMPOwner        TagID = "XMP-xmpRights:Owner"        // Rights owner
	TagXMPUsageTerms   TagID = "XMP-xmpRights:UsageTerms"   // Usage terms
	TagXMPWebStatement TagID = "XMP-xmpRights:WebStatement" // Web rights statement
)

XMP Rights (xmpRights) Tags

const (
	TagXMPPhotoshopCity          TagID = "XMP-photoshop:City"            // City
	TagXMPPhotoshopState         TagID = "XMP-photoshop:State"           // State/Province
	TagXMPPhotoshopCountry       TagID = "XMP-photoshop:Country"         // Country
	TagXMPPhotoshopCredit        TagID = "XMP-photoshop:Credit"          // Credit line
	TagXMPPhotoshopSource        TagID = "XMP-photoshop:Source"          // Source
	TagXMPPhotoshopHeadline      TagID = "XMP-photoshop:Headline"        // Headline
	TagXMPPhotoshopInstructions  TagID = "XMP-photoshop:Instructions"    // Instructions
	TagXMPPhotoshopDateCreated   TagID = "XMP-photoshop:DateCreated"     // Date created
	TagXMPPhotoshopAuthorsPos    TagID = "XMP-photoshop:AuthorsPosition" // Author's position
	TagXMPPhotoshopCaptionWriter TagID = "XMP-photoshop:CaptionWriter"   // Caption writer
	TagXMPPhotoshopCategory      TagID = "XMP-photoshop:Category"        // Category
	TagXMPPhotoshopColorMode     TagID = "XMP-photoshop:ColorMode"       // Color mode
	TagXMPPhotoshopICCProfile    TagID = "XMP-photoshop:ICCProfile"      // ICC profile name
)

XMP Photoshop Tags

const (
	TagXMPTIFFMake        TagID = "XMP-tiff:Make"        // Camera make
	TagXMPTIFFModel       TagID = "XMP-tiff:Model"       // Camera model
	TagXMPTIFFOrientation TagID = "XMP-tiff:Orientation" // Image orientation
	TagXMPTIFFXResolution TagID = "XMP-tiff:XResolution" // X resolution
	TagXMPTIFFYResolution TagID = "XMP-tiff:YResolution" // Y resolution
	TagXMPTIFFImageWidth  TagID = "XMP-tiff:ImageWidth"  // Image width
	TagXMPTIFFImageLength TagID = "XMP-tiff:ImageLength" // Image height
)

XMP TIFF Tags (via XMP)

const (
	TagXMPExifDateTimeOriginal TagID = "XMP-exif:DateTimeOriginal" // Date/time taken
	TagXMPExifExposureTime     TagID = "XMP-exif:ExposureTime"     // Exposure time
	TagXMPExifFNumber          TagID = "XMP-exif:FNumber"          // Aperture
	TagXMPExifISOSpeedRatings  TagID = "XMP-exif:ISOSpeedRatings"  // ISO
	TagXMPExifFocalLength      TagID = "XMP-exif:FocalLength"      // Focal length
	TagXMPExifFlash            TagID = "XMP-exif:Flash"            // Flash info
	TagXMPExifGPSLatitude      TagID = "XMP-exif:GPSLatitude"      // GPS latitude
	TagXMPExifGPSLongitude     TagID = "XMP-exif:GPSLongitude"     // GPS longitude
	TagXMPExifGPSAltitude      TagID = "XMP-exif:GPSAltitude"      // GPS altitude
)

XMP EXIF Tags (via XMP)

const (
	TagICCProfileSize        TagID = "ICC:ProfileSize"        // Profile size in bytes
	TagICCPreferredCMM       TagID = "ICC:PreferredCMM"       // Preferred CMM
	TagICCVersion            TagID = "ICC:Version"            // Profile version
	TagICCProfileClass       TagID = "ICC:ProfileClass"       // Profile class
	TagICCColorSpace         TagID = "ICC:ColorSpace"         // Color space
	TagICCPCS                TagID = "ICC:PCS"                // Profile connection space
	TagICCCreateDate         TagID = "ICC:CreateDate"         // Profile creation date
	TagICCPlatform           TagID = "ICC:Platform"           // Primary platform
	TagICCRenderingIntent    TagID = "ICC:RenderingIntent"    // Rendering intent
	TagICCDeviceManufacturer TagID = "ICC:DeviceManufacturer" // Device manufacturer
	TagICCDeviceModel        TagID = "ICC:DeviceModel"        // Device model
	TagICCCreator            TagID = "ICC:Creator"            // Profile creator
	TagICCPCSIlluminant      TagID = "ICC:PCSIlluminant"      // PCS illuminant
	TagICCProfileFlags       TagID = "ICC:ProfileFlags"       // Profile flags
	TagICCDeviceAttributes   TagID = "ICC:DeviceAttributes"   // Device attributes
	TagICCProfileID          TagID = "ICC:ProfileID"          // Profile ID (MD5 hash)
)

ICC Profile Header Tags (from icc.go addTag calls)

const (
	TagICCProfileDescription  TagID = "ICC:ProfileDescription"  // Profile description
	TagICCProfileCopyright    TagID = "ICC:ProfileCopyright"    // Copyright notice
	TagICCMediaWhitePoint     TagID = "ICC:MediaWhitePoint"     // Media white point XYZ
	TagICCMediaBlackPoint     TagID = "ICC:MediaBlackPoint"     // Media black point XYZ
	TagICCChromaticAdaptation TagID = "ICC:ChromaticAdaptation" // Chromatic adaptation matrix
)

ICC Parsed Tag Values (human-readable names from knownTags)

const (
	TagICCRedMatrixColumn   TagID = "ICC:RedMatrixColumn"   // Red matrix column XYZ
	TagICCGreenMatrixColumn TagID = "ICC:GreenMatrixColumn" // Green matrix column XYZ
	TagICCBlueMatrixColumn  TagID = "ICC:BlueMatrixColumn"  // Blue matrix column XYZ
)

ICC Color Matrix Tags

const (
	TagICCRedTRC   TagID = "ICC:RedToneReproductionCurve"   // Red TRC
	TagICCGreenTRC TagID = "ICC:GreenToneReproductionCurve" // Green TRC
	TagICCBlueTRC  TagID = "ICC:BlueToneReproductionCurve"  // Blue TRC
	TagICCGrayTRC  TagID = "ICC:GrayToneReproductionCurve"  // Gray TRC
)

ICC Tone Reproduction Curve Tags

const (
	TagICCDeviceMfgDesc         TagID = "ICC:DeviceManufacturerDescription" // Device mfg description
	TagICCDeviceModelDesc       TagID = "ICC:DeviceModelDescription"        // Device model description
	TagICCTechnology            TagID = "ICC:Technology"                    // Device technology
	TagICCViewingConditionsDesc TagID = "ICC:ViewingConditionsDescription"  // Viewing conditions
	TagICCLuminance             TagID = "ICC:Luminance"                     // Luminance value
	TagICCMeasurement           TagID = "ICC:Measurement"                   // Measurement info
)

ICC Device Description Tags

Image Directories

Path Synopsis
cmd
imx module
examples
basic command
internal
bufpool
Package bufpool provides a buffer pool for reducing GC pressure from repeated small buffer allocations.
Package bufpool provides a buffer pool for reducing GC pressure from repeated small buffer allocations.
parser/heic
Package heic implements a parser for HEIC/HEIF and AVIF image files.
Package heic implements a parser for HEIC/HEIF and AVIF image files.
parser/tiff/makernote
Package makernote provides MakerNote parsing for camera manufacturer-specific metadata.
Package makernote provides MakerNote parsing for camera manufacturer-specific metadata.
parser/tiff/makernote/canon
Package canon provides parsing for Canon MakerNote data.
Package canon provides parsing for Canon MakerNote data.
parser/tiff/makernote/fujifilm
Package fujifilm implements Fujifilm MakerNote parsing.
Package fujifilm implements Fujifilm MakerNote parsing.
parser/tiff/makernote/nikon
Package nikon implements Nikon MakerNote parsing.
Package nikon implements Nikon MakerNote parsing.
parser/tiff/makernote/sony
Package sony implements Sony MakerNote parsing.
Package sony implements Sony MakerNote parsing.

Jump to

Keyboard shortcuts

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