exif

package
v0.0.0-...-3cbae95 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: BSD-3-Clause, Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package exif implements the Exif 2.3.1 metadata standard as defined in CIPA DC-008-2016.

Index

Constants

View Source
const EXIF_DATE_FORMAT = "2006:01:02 15:04:05"

Variables

View Source
var (
	NsExif    *xmp.Namespace = xmp.NewNamespace("exif", "http://ns.adobe.com/exif/1.0/", NewModel)
	NsExifEX  *xmp.Namespace = xmp.NewNamespace("exifEX", "http://cipa.jp/exif/1.0/", NewModel)
	NsExifAux *xmp.Namespace = xmp.NewNamespace("aux", "http://ns.adobe.com/exif/1.0/aux/", NewModel)
)

Functions

func NewModel

func NewModel(name string) xmp.Model

Types

type ByteArray

type ByteArray []byte

func (ByteArray) MarshalText

func (x ByteArray) MarshalText() ([]byte, error)

func (ByteArray) String

func (x ByteArray) String() string

func (*ByteArray) UnmarshalText

func (x *ByteArray) UnmarshalText(data []byte) error

type CFAPattern

type CFAPattern struct {
	Columns int       `xmp:"exif:Columns"`
	Rows    int       `xmp:"exif:Rows"`
	Values  ByteArray `xmp:"exif:Values"`
}

func (*CFAPattern) Addr

func (x *CFAPattern) Addr() *CFAPattern

func (CFAPattern) IsZero

func (x CFAPattern) IsZero() bool

func (CFAPattern) MarshalXMP

func (x CFAPattern) MarshalXMP(e *xmp.Encoder, node *xmp.Node, m xmp.Model) error

func (*CFAPattern) UnmarshalText

func (x *CFAPattern) UnmarshalText(data []byte) error

type ColorSpace

type ColorSpace int
const (
	ColorSpaceSRGB         ColorSpace = 1
	ColorSpaceUncalibrated ColorSpace = 0xffff
)

type Component

type Component int
const (
	ComponentNone Component = 0
	ComponentY    Component = 1
	ComponentCb   Component = 2
	ComponentCr   Component = 3
	ComponentR    Component = 4
	ComponentG    Component = 5
	ComponentB    Component = 6
)

type ComponentArray

type ComponentArray []Component

func (ComponentArray) MarshalXMP

func (x ComponentArray) MarshalXMP(e *xmp.Encoder, node *xmp.Node, m xmp.Model) error

func (ComponentArray) String

func (x ComponentArray) String() string

func (ComponentArray) Typ

func (x ComponentArray) Typ() xmp.ArrayType

func (*ComponentArray) UnmarshalXMP

func (x *ComponentArray) UnmarshalXMP(d *xmp.Decoder, node *xmp.Node, m xmp.Model) error

type ContrastMode

type ContrastMode int
const (
	ContrastModeNormal ContrastMode = 0
	ContrastModeSoft   ContrastMode = 1
	ContrastModeHard   ContrastMode = 2
)

type Date

type Date time.Time

func Now

func Now() Date

func (Date) IsZero

func (x Date) IsZero() bool

func (Date) MarshalText

func (x Date) MarshalText() ([]byte, error)

func (Date) MarshalXMP

func (x Date) MarshalXMP(e *xmp.Encoder, node *xmp.Node, m xmp.Model) error

func (*Date) UnmarshalText

func (x *Date) UnmarshalText(data []byte) error

func (Date) Value

func (x Date) Value() time.Time

type DeviceSettings

type DeviceSettings struct {
	Columns int             `xmp:"exif:Columns"`
	Rows    int             `xmp:"exif:Rows"`
	Values  xmp.StringArray `xmp:"exif:Values"`
}

func (*DeviceSettings) Addr

func (x *DeviceSettings) Addr() *DeviceSettings

func (DeviceSettings) IsZero

func (x DeviceSettings) IsZero() bool

func (DeviceSettings) MarshalXMP

func (x DeviceSettings) MarshalXMP(e *xmp.Encoder, node *xmp.Node, m xmp.Model) error

func (*DeviceSettings) UnmarshalText

func (x *DeviceSettings) UnmarshalText(data []byte) error

type ExifAuxInfo

type ExifAuxInfo struct {
	ApproximateFocusDistance                           xmp.Rational `xmp:"aux:ApproximateFocusDistance"`                           // 315/10
	DistortionCorrectionAlreadyApplied                 xmp.Bool     `xmp:"aux:DistortionCorrectionAlreadyApplied"`                 //
	SerialNumber                                       string       `xmp:"aux:SerialNumber"`                                       // 2481231346
	LensInfo                                           string       `xmp:"aux:LensInfo"`                                           // 10/1 22/1 0/0 0/0
	LensDistortInfo                                    string       `xmp:"aux:LensDistortInfo"`                                    //
	Lens                                               string       `xmp:"aux:Lens"`                                               // EF-S10-22mm f/3.5-4.5 USM
	LensID                                             string       `xmp:"aux:LensID"`                                             // 235
	LensSerialNumber                                   string       `xmp:"aux:LensSerialNumber"`                                   //
	ImageNumber                                        int          `xmp:"aux:ImageNumber"`                                        // 0
	IsMergedHDR                                        xmp.Bool     `xmp:"aux:IsMergedHDR"`                                        //
	IsMergedPanorama                                   xmp.Bool     `xmp:"aux:IsMergedPanorama"`                                   //
	LateralChromaticAberrationCorrectionAlreadyApplied xmp.Bool     `xmp:"aux:LateralChromaticAberrationCorrectionAlreadyApplied"` //
	VignetteCorrectionAlreadyApplied                   xmp.Bool     `xmp:"aux:VignetteCorrectionAlreadyApplied"`                   //
	FlashCompensation                                  xmp.Rational `xmp:"aux:FlashCompensation"`                                  // 0/1
	Firmware                                           string       `xmp:"aux:Firmware"`                                           // 1.2.5
	OwnerName                                          string       `xmp:"aux:OwnerName"`                                          // unknown
}

XMP-EXIF Extra Mappings (XMP only) The schema namespace URI is http://ns.adobe.com/exif/1.0/aux/ The preferred schema namespace prefix is aux

Adobe-defined auxiliary EXIF tags. This namespace existed in the XMP specification until it was dropped in 2012, presumably due to the introduction of the EXIF 2.3 for XMP specification and the exifEX namespace at this time.

func (*ExifAuxInfo) Can

func (m *ExifAuxInfo) Can(nsName string) bool

func (*ExifAuxInfo) CanTag

func (x *ExifAuxInfo) CanTag(tag string) bool

func (*ExifAuxInfo) GetTag

func (x *ExifAuxInfo) GetTag(tag string) (string, error)

func (*ExifAuxInfo) Namespaces

func (m *ExifAuxInfo) Namespaces() xmp.NamespaceList

func (*ExifAuxInfo) SetTag

func (x *ExifAuxInfo) SetTag(tag, value string) error

func (*ExifAuxInfo) SyncFromXMP

func (x *ExifAuxInfo) SyncFromXMP(d *xmp.Document) error

func (*ExifAuxInfo) SyncModel

func (x *ExifAuxInfo) SyncModel(d *xmp.Document) error

func (ExifAuxInfo) SyncToXMP

func (x ExifAuxInfo) SyncToXMP(d *xmp.Document) error

type ExifEXInfo

type ExifEXInfo struct {
	InteroperabilityIndex     InteropMode       `exif:"0x0001" xmp:"exifEX:InteroperabilityIndex"`
	InteroperabilityVersion   string            `exif:"0x0002" xmp:"exifEX:InteroperabilityVersion"`
	RelatedImageFileFormat    string            `exif:"0x1000" xmp:"exifEX:RelatedImageFileFormat"`
	RelatedImageWidth         int               `exif:"0x1001" xmp:"exifEX:RelatedImageWidth"`
	RelatedImageLength        int               `exif:"0x1002" xmp:"exifEX:RelatedImageLength"`
	PhotographicSensitivity   int               `exif:"0x8827" xmp:"exifEX:PhotographicSensitivity"`
	SensitivityType           SensitivityType   `exif:"0x8830" xmp:"exifEX:SensitivityType"`
	StandardOutputSensitivity int               `exif:"0x8831" xmp:"exifEX:StandardOutputSensitivity"`
	RecommendedExposureIndex  int               `exif:"0x8832" xmp:"exifEX:RecommendedExposureIndex"`
	ISOSpeed                  int               `exif:"0x8833" xmp:"exifEX:ISOSpeed"`
	ISOSpeedLatitudeyyy       int               `exif:"0x8834" xmp:"exifEX:ISOSpeedLatitudeyyy"`
	ISOSpeedLatitudezzz       int               `exif:"0x8835" xmp:"exifEX:ISOSpeedLatitudezzz"`
	CameraOwnerName           string            `exif:"0xa430" xmp:"exifEX:CameraOwnerName"`
	BodySerialNumber          string            `exif:"0xa431" xmp:"exifEX:BodySerialNumber"`
	LensSpecification         xmp.RationalArray `exif:"0xa432" xmp:"exifEX:LensSpecification"` // 4 components: min/max [mm] + min/max [f-stop]
	LensMake                  string            `exif:"0xa433" xmp:"exifEX:LensMake"`
	LensModel                 string            `exif:"0xa434" xmp:"exifEX:LensModel"`
	LensSerialNumber          string            `exif:"0xa435" xmp:"exifEX:LensSerialNumber"`
	Gamma                     xmp.Rational      `exif:"0xa500" xmp:"exifEX:Gamma"`
}

func (*ExifEXInfo) Can

func (m *ExifEXInfo) Can(nsName string) bool

func (*ExifEXInfo) CanTag

func (x *ExifEXInfo) CanTag(tag string) bool

func (*ExifEXInfo) GetTag

func (x *ExifEXInfo) GetTag(tag string) (string, error)

func (*ExifEXInfo) Namespaces

func (m *ExifEXInfo) Namespaces() xmp.NamespaceList

func (*ExifEXInfo) SetTag

func (x *ExifEXInfo) SetTag(tag, value string) error

func (*ExifEXInfo) SyncFromXMP

func (x *ExifEXInfo) SyncFromXMP(d *xmp.Document) error

func (*ExifEXInfo) SyncModel

func (x *ExifEXInfo) SyncModel(d *xmp.Document) error

func (ExifEXInfo) SyncToXMP

func (x ExifEXInfo) SyncToXMP(d *xmp.Document) error

type ExifInfo

type ExifInfo struct {
	// Tiff Info part of Exif info
	Artist                    string                `exif:"0x013b" xmp:"tiff:Artist,omit"`
	ArtistXMP                 xmp.StringList        `exif:"-"      xmp:"dc:creator"`
	BitsPerSample             xmp.IntList           `exif:"0x0102" xmp:"tiff:BitsPerSample"` // 3 components
	Compression               tiff.CompressionType  `exif:"0x0103" xmp:"tiff:Compression"`
	Copyright                 string                `exif:"0x8298" xmp:"tiff:Copyright,omit"`
	CopyrightXMP              xmp.AltString         `exif:"-"      xmp:"dc:rights"`
	DateTime                  Date                  `exif:"0x0132" xmp:"tiff:DateTime,omit"`
	DateTimeXMP               xmp.Date              `exif:"-"      xmp:"xmp:ModifyDate"`
	ImageDescription          string                `exif:"0x010e" xmp:"tiff:ImageDescription,omit"`
	ImageDescriptionXMP       xmp.AltString         `exif:"-"      xmp:"dc:description"`
	ImageLength               int                   `exif:"0x0101" xmp:"tiff:ImageLength"`
	ImageWidth                int                   `exif:"0x0100" xmp:"tiff:ImageWidth"` // A. Tags relating to image data structure
	Make                      string                `exif:"0x010f" xmp:"tiff:Make"`
	Model                     string                `exif:"0x0110" xmp:"tiff:Model"`
	Orientation               tiff.OrientationType  `exif:"0x0112" xmp:"tiff:Orientation"`
	PhotometricInterpretation tiff.ColorModel       `exif:"0x0106" xmp:"tiff:PhotometricInterpretation"`
	PlanarConfiguration       tiff.PlanarType       `exif:"0x011c" xmp:"tiff:PlanarConfiguration"`
	PrimaryChromaticities     xmp.RationalArray     `exif:"0x013f" xmp:"tiff:PrimaryChromaticities"` // 6 components
	ReferenceBlackWhite       xmp.RationalArray     `exif:"0x0214" xmp:"tiff:ReferenceBlackWhite"`   // 6 components
	ResolutionUnit            tiff.ResolutionUnit   `exif:"0x0128" xmp:"tiff:ResolutionUnit"`        // 2 = inches, 3 = centimeters
	SamplesPerPixel           int                   `exif:"0x0115" xmp:"tiff:SamplesPerPixel"`
	Software                  string                `exif:"0x0131" xmp:"tiff:Software,omit"`
	SoftwareXMP               xmp.AgentName         `exif:"-"      xmp:"xmp:CreatorTool"`
	TransferFunction          xmp.IntList           `exif:"0x012d" xmp:"tiff:TransferFunction"` // C. Tags relating to image data characteristics
	WhitePoint                xmp.RationalArray     `exif:"0x013e" xmp:"tiff:WhitePoint"`
	XResolution               xmp.Rational          `exif:"0x011a" xmp:"tiff:XResolution"`
	YCbCrCoefficients         xmp.RationalArray     `exif:"0x0211" xmp:"tiff:YCbCrCoefficients"` // 3 components
	YCbCrPositioning          tiff.YCbCrPosition    `exif:"0x0213" xmp:"tiff:YCbCrPositioning"`
	YCbCrSubSampling          tiff.YCbCrSubSampling `exif:"0x0212" xmp:"tiff:YCbCrSubSampling"`
	YResolution               xmp.Rational          `exif:"0x011b" xmp:"tiff:YResolution"`

	// Exif info
	ExifVersion              string              `exif:"0x9000" xmp:"exif:ExifVersion"`
	FlashpixVersion          string              `exif:"0xa000" xmp:"exif:FlashpixVersion"`
	ColorSpace               ColorSpace          `exif:"0xa001" xmp:"exif:ColorSpace,empty"`
	ComponentsConfiguration  ComponentArray      `exif:"0x9101" xmp:"exif:ComponentsConfiguration"`
	CompressedBitsPerPixel   xmp.Rational        `exif:"0x9102" xmp:"exif:CompressedBitsPerPixel"`
	PixelXDimension          int                 `exif:"0xa002" xmp:"exif:PixelXDimension"`
	PixelYDimension          int                 `exif:"0xa003" xmp:"exif:PixelYDimension"`
	MakerNote                ByteArray           `exif:"0x927c" xmp:"exif:MakerNote,omit"`
	UserComment              xmp.StringArray     `exif:"0x9286" xmp:"exif:UserComment"`
	RelatedSoundFile         string              `exif:"0xa004" xmp:"exif:RelatedSoundFile"`
	DateTimeOriginal         Date                `exif:"0x9003" xmp:"exif:DateTimeOriginal,omit"`
	DateTimeOriginalXMP      xmp.Date            `exif:"-"      xmp:"photoshop:DateCreated"`
	DateTimeDigitized        Date                `exif:"0x9004" xmp:"-"`
	DateTimeDigitizedXMP     xmp.Date            `exif:"-"      xmp:"exif:DateTimeDigitized"`
	SubSecTime               string              `exif:"0x9290" xmp:"exif:SubSecTime,omit"`
	SubSecTimeOriginal       string              `exif:"0x9291" xmp:"exif:SubSecTimeOriginal,omit"`
	SubSecTimeDigitized      string              `exif:"0x9292" xmp:"exif:SubSecTimeDigitized,omit"`
	ExposureTime             xmp.Rational        `exif:"0x829a" xmp:"exif:ExposureTime"`
	FNumber                  xmp.Rational        `exif:"0x829d" xmp:"exif:FNumber"`
	ExposureProgram          ExposureProgram     `exif:"0x8822" xmp:"exif:ExposureProgram,empty"`
	SpectralSensitivity      string              `exif:"0x8824" xmp:"exif:SpectralSensitivity"`
	OECF                     *OECF               `exif:"0x8828" xmp:"exif:OECF"`
	ShutterSpeedValue        xmp.Rational        `exif:"0x9201" xmp:"exif:ShutterSpeedValue"`
	ApertureValue            xmp.Rational        `exif:"0x9202" xmp:"exif:ApertureValue"`
	BrightnessValue          xmp.Rational        `exif:"0x9203" xmp:"exif:BrightnessValue"`
	ExposureBiasValue        xmp.Rational        `exif:"0x9204" xmp:"exif:ExposureBiasValue"`
	MaxApertureValue         xmp.Rational        `exif:"0x9205" xmp:"exif:MaxApertureValue"`
	SubjectDistance          xmp.Rational        `exif:"0x9206" xmp:"exif:SubjectDistance"`
	MeteringMode             MeteringMode        `exif:"0x9207" xmp:"exif:MeteringMode,empty"`
	LightSource              LightSource         `exif:"0x9208" xmp:"exif:LightSource,empty"`
	Flash                    Flash               `exif:"0x9209" xmp:"exif:Flash"`
	FocalLength              xmp.Rational        `exif:"0x920a" xmp:"exif:FocalLength"`
	SubjectArea              xmp.IntList         `exif:"0x9214" xmp:"exif:SubjectArea"`
	FlashEnergy              xmp.Rational        `exif:"0xa20b" xmp:"exif:FlashEnergy"`
	SpatialFrequencyResponse *OECF               `exif:"0xa20c" xmp:"exif:SpatialFrequencyResponse"`
	FocalPlaneXResolution    xmp.Rational        `exif:"0xa20e" xmp:"exif:FocalPlaneXResolution"`
	FocalPlaneYResolution    xmp.Rational        `exif:"0xa20f" xmp:"exif:FocalPlaneYResolution"`
	FocalPlaneResolutionUnit tiff.ResolutionUnit `exif:"0xa210" xmp:"exif:FocalPlaneResolutionUnit,empty"`
	SubjectLocation          xmp.IntList         `exif:"0xa214" xmp:"exif:SubjectLocation"`
	ExposureIndex            xmp.Rational        `exif:"0xa215" xmp:"exif:ExposureIndex"`
	SensingMethod            SensingMode         `exif:"0xa217" xmp:"exif:SensingMethod,empty"`
	FileSource               FileSourceType      `exif:"0xa300" xmp:"exif:FileSource,empty"`
	SceneType                int                 `exif:"0xa301" xmp:"exif:SceneType,empty"`
	CFAPattern               *CFAPattern         `exif:"0xa302" xmp:"exif:CFAPattern"`
	CustomRendered           RenderMode          `exif:"0xa401" xmp:"exif:CustomRendered,empty"`
	ExposureMode             ExposureMode        `exif:"0xa402" xmp:"exif:ExposureMode,empty"`
	WhiteBalance             WhiteBalanceMode    `exif:"0xa403" xmp:"exif:WhiteBalance,empty"`
	DigitalZoomRatio         xmp.Rational        `exif:"0xa404" xmp:"exif:DigitalZoomRatio"`
	FocalLengthIn35mmFilm    int                 `exif:"0xa405" xmp:"exif:FocalLengthIn35mmFilm"`
	SceneCaptureType         SceneCaptureType    `exif:"0xa406" xmp:"exif:SceneCaptureType,empty"`
	GainControl              GainMode            `exif:"0xa407" xmp:"exif:GainControl,empty"`
	Contrast                 ContrastMode        `exif:"0xa408" xmp:"exif:Contrast,empty"`
	Saturation               SaturationMode      `exif:"0xa409" xmp:"exif:Saturation,empty"`
	Sharpness                SharpnessMode       `exif:"0xa40a" xmp:"exif:Sharpness,empty"`
	DeviceSettingDescription DeviceSettings      `exif:"0xa40b" xmp:"exif:DeviceSettingDescription"`
	SubjectDistanceRange     SubjectDistanceMode `exif:"0xa40c" xmp:"exif:SubjectDistanceRange,empty"`
	ImageUniqueID            string              `exif:"0xa420" xmp:"exif:ImageUniqueID"`
	GPSVersionID             string              `exif:"0x0000" xmp:"exif:GPSVersionID"`
	GPSLatitudeRef           string              `exif:"0x0001" xmp:"-"` // N, S
	GPSLatitude              GPSCoord            `exif:"0x0002" xmp:"-"` // 1 float or 3 rational components
	GPSLatitudeCoord         xmp.GPSCoord        `exif:"-"      xmp:"exif:GPSLatitude"`
	GPSLongitudeRef          string              `exif:"0x0003" xmp:"-"` // E, W
	GPSLongitude             GPSCoord            `exif:"0x0004" xmp:"-"` // 1 float or 3 rational components
	GPSLongitudeCoord        xmp.GPSCoord        `exif:"-"      xmp:"exif:GPSLongitude"`
	GPSAltitudeRef           string              `exif:"0x0005" xmp:"exif:GPSAltitudeRef"`
	GPSAltitude              xmp.Rational        `exif:"0x0006" xmp:"exif:GPSAltitude"`
	GPSTimeStamp             xmp.RationalArray   `exif:"0x0007" xmp:"-"` // 3 components: hour/min/sec in UTC
	GPSDateStamp             Date                `exif:"0x001d" xmp:"-"` // YYYY:MM:DD
	GPSTimeStampXMP          xmp.Date            `exif:"-"      xmp:"exif:GPSTimeStamp"`
	GPSSatellites            string              `exif:"0x0008" xmp:"exif:GPSSatellites"`
	GPSStatus                string              `exif:"0x0009" xmp:"exif:GPSStatus"`
	GPSMeasureMode           string              `exif:"0x000a" xmp:"exif:GPSMeasureMode"`
	GPSDOP                   xmp.Rational        `exif:"0x000b" xmp:"exif:GPSDOP"`
	GPSSpeedRef              string              `exif:"0x000c" xmp:"exif:GPSSpeedRef"`
	GPSSpeed                 xmp.Rational        `exif:"0x000d" xmp:"exif:GPSSpeed"`
	GPSTrackRef              string              `exif:"0x000e" xmp:"exif:GPSTrackRef"`
	GPSTrack                 xmp.Rational        `exif:"0x000f" xmp:"exif:GPSTrack"`
	GPSImgDirectionRef       string              `exif:"0x0010" xmp:"exif:GPSImgDirectionRef"`
	GPSImgDirection          xmp.Rational        `exif:"0x0011" xmp:"exif:GPSImgDirection"`
	GPSMapDatum              string              `exif:"0x0012" xmp:"exif:GPSMapDatum"`
	GPSDestLatitudeRef       string              `exif:"0x0013" xmp:"-"` // N, S
	GPSDestLatitude          GPSCoord            `exif:"0x0014" xmp:"-"` // 1 float or 3 rational components
	GPSDestLatitudeCoord     xmp.GPSCoord        `exif:"-"      xmp:"exif:GPSDestLatitude"`
	GPSDestLongitudeRef      string              `exif:"0x0015" xmp:"-"` // E, W
	GPSDestLongitude         GPSCoord            `exif:"0x0016" xmp:"-"` // 1 float or 3 rational components
	GPSDestLongitudeCoord    xmp.GPSCoord        `exif:"-"      xmp:"exif:GPSDestLongitude"`
	GPSDestBearingRef        string              `exif:"0x0017" xmp:"exif:GPSDestBearingRef"`
	GPSDestBearing           xmp.Rational        `exif:"0x0018" xmp:"exif:GPSDestBearing"`
	GPSDestDistanceRef       string              `exif:"0x0019" xmp:"exif:GPSDestDistanceRef"`
	GPSDestDistance          xmp.Rational        `exif:"0x001a" xmp:"exif:GPSDestDistance"`
	GPSProcessingMethod      string              `exif:"0x001b" xmp:"exif:GPSProcessingMethod"`
	GPSAreaInformation       string              `exif:"0x001c" xmp:"exif:GPSAreaInformation"`
	GPSDifferential          int                 `exif:"0x001e" xmp:"exif:GPSDifferential"`
	GPSHPositioningError     xmp.Rational        `exif:"0x001f" xmp:"exif:GPSHPositioningError"`
	NativeDigest             string              `exif:"-"      xmp:"exif:NativeDigest,omit"` // ingore according to spec

	// replaced by exifEX ExPhotographicSensitivity
	ISOSpeedRatings xmp.IntList `exif:"-" xmp:"exif:ISOSpeedRatings,omit"`

	// ExifEX namespace
	// ExInteroperabilityIndex     InteropMode       `exif:"0x0001" xmp:"exif:InteroperabilityIndex"`
	// ExInteroperabilityVersion   string            `exif:"0x0002" xmp:"exif:InteroperabilityVersion"`
	ExRelatedImageFileFormat    string            `exif:"0x1000" xmp:"exif:RelatedImageFileFormat"`
	ExRelatedImageWidth         int               `exif:"0x1001" xmp:"exif:RelatedImageWidth"`
	ExRelatedImageLength        int               `exif:"0x1002" xmp:"exif:RelatedImageLength"`
	ExPhotographicSensitivity   int               `exif:"0x8827" xmp:"exif:PhotographicSensitivity"`
	ExSensitivityType           SensitivityType   `exif:"0x8830" xmp:"exif:SensitivityType"`
	ExStandardOutputSensitivity int               `exif:"0x8831" xmp:"exif:StandardOutputSensitivity"`
	ExRecommendedExposureIndex  int               `exif:"0x8832" xmp:"exif:RecommendedExposureIndex"`
	ExISOSpeed                  int               `exif:"0x8833" xmp:"exif:ISOSpeed"`
	ExISOSpeedLatitudeyyy       int               `exif:"0x8834" xmp:"exif:ISOSpeedLatitudeyyy"`
	ExISOSpeedLatitudezzz       int               `exif:"0x8835" xmp:"exif:ISOSpeedLatitudezzz"`
	ExCameraOwnerName           string            `exif:"0xa430" xmp:"exif:CameraOwnerName"`
	ExBodySerialNumber          string            `exif:"0xa431" xmp:"exif:BodySerialNumber"`
	ExLensSpecification         xmp.RationalArray `exif:"0xa432" xmp:"exif:LensSpecification"` // 4 components: min/max [mm] + min/max [f-stop]
	ExLensMake                  string            `exif:"0xa433" xmp:"exif:LensMake"`
	ExLensModel                 string            `exif:"0xa434" xmp:"exif:LensModel"`
	ExLensSerialNumber          string            `exif:"0xa435" xmp:"exif:LensSerialNumber"`
	ExGamma                     xmp.Rational      `exif:"0xa500" xmp:"exif:Gamma"`

	// non-standard prefixed ExifAux namespace
	AuxApproximateFocusDistance                           xmp.Rational `xmp:"exif:ApproximateFocusDistance"` // 315/10
	AuxDistortionCorrectionAlreadyApplied                 xmp.Bool     `xmp:"exif:DistortionCorrectionAlreadyApplied"`
	AuxSerialNumber                                       string       `xmp:"exif:SerialNumber"`                                       // 2481231346
	AuxLensInfo                                           string       `xmp:"exif:LensInfo"`                                           // 10/1 22/1 0/0 0/0
	AuxLensDistortInfo                                    string       `xmp:"exif:LensDistortInfo"`                                    //
	AuxLens                                               string       `xmp:"exif:Lens"`                                               // EF-S10-22mm f/3.5-4.5 USM
	AuxLensID                                             string       `xmp:"exif:LensID"`                                             // 235
	AuxImageNumber                                        int          `xmp:"exif:ImageNumber"`                                        // 0
	AuxIsMergedHDR                                        xmp.Bool     `xmp:"exif:IsMergedHDR"`                                        //
	AuxIsMergedPanorama                                   xmp.Bool     `xmp:"exif:IsMergedPanorama"`                                   //
	AuxLateralChromaticAberrationCorrectionAlreadyApplied xmp.Bool     `xmp:"exif:LateralChromaticAberrationCorrectionAlreadyApplied"` //
	AuxVignetteCorrectionAlreadyApplied                   xmp.Bool     `xmp:"exif:VignetteCorrectionAlreadyApplied"`                   //
	AuxFlashCompensation                                  xmp.Rational `xmp:"exif:FlashCompensation"`                                  // 0/1
	AuxFirmware                                           string       `xmp:"exif:Firmware"`                                           // 1.2.5
	AuxOwnerName                                          string       `xmp:"exif:OwnerName"`                                          // unknown

}

func FindModel

func FindModel(d *xmp.Document) *ExifInfo

func MakeModel

func MakeModel(d *xmp.Document) (*ExifInfo, error)

func (*ExifInfo) Can

func (m *ExifInfo) Can(nsName string) bool

func (*ExifInfo) CanTag

func (x *ExifInfo) CanTag(tag string) bool

func (*ExifInfo) GetLocaleTag

func (x *ExifInfo) GetLocaleTag(lang string, tag string) (string, error)

func (*ExifInfo) GetTag

func (x *ExifInfo) GetTag(tag string) (string, error)

func (*ExifInfo) Namespaces

func (m *ExifInfo) Namespaces() xmp.NamespaceList

func (*ExifInfo) SetLocaleTag

func (x *ExifInfo) SetLocaleTag(lang string, tag, value string) error

func (*ExifInfo) SetTag

func (x *ExifInfo) SetTag(tag, value string) error

func (*ExifInfo) SyncFromXMP

func (x *ExifInfo) SyncFromXMP(d *xmp.Document) error

func (*ExifInfo) SyncModel

func (x *ExifInfo) SyncModel(d *xmp.Document) error

func (*ExifInfo) SyncToXMP

func (x *ExifInfo) SyncToXMP(d *xmp.Document) error

type ExposureMode

type ExposureMode int
const (
	ExposureModeAuto    ExposureMode = 0
	ExposureModeManual  ExposureMode = 1
	ExposureModeBracket ExposureMode = 2
)

type ExposureProgram

type ExposureProgram int
const (
	ExposureProgramUndefined        ExposureProgram = 0
	ExposureProgramManual           ExposureProgram = 1
	ExposureProgramNormalProgram    ExposureProgram = 2
	ExposureProgramAperturePriority ExposureProgram = 3
	ExposureProgramShutterPriority  ExposureProgram = 4
	ExposureProgramCreative         ExposureProgram = 5
	ExposureProgramAction           ExposureProgram = 6
	ExposureProgramPortrait         ExposureProgram = 7
	ExposureProgramLandscape        ExposureProgram = 8
	ExposureProgramBulb             ExposureProgram = 9
)

type FileSourceType

type FileSourceType int
const (
	FileSourceOther              FileSourceType = 0
	FileSourceScannerTransparent FileSourceType = 1
	FileSourceScannerReflex      FileSourceType = 2
	FileSourceDSC                FileSourceType = 3
)

type Flash

type Flash struct {
	Fired      xmp.Bool        `xmp:"exif:Fired,attr,empty"`
	Function   xmp.Bool        `xmp:"exif:Function,attr,empty"`
	Mode       FlashMode       `xmp:"exif:Mode,attr,empty"`
	RedEyeMode xmp.Bool        `xmp:"exif:RedEyeMode,attr,empty"`
	Return     FlashReturnMode `xmp:"exif:Return,attr,empty"`
}

func (Flash) IsZero

func (x Flash) IsZero() bool

func (Flash) MarshalXMP

func (x Flash) MarshalXMP(e *xmp.Encoder, node *xmp.Node, m xmp.Model) error

func (*Flash) UnmarshalText

func (x *Flash) UnmarshalText(data []byte) error

func (*Flash) UnmarshalXMP

func (x *Flash) UnmarshalXMP(d *xmp.Decoder, node *xmp.Node, m xmp.Model) error

type FlashMode

type FlashMode int
const (
	FlashModeUnknown  FlashMode = 0
	FlashModeFire     FlashMode = 1
	FlashModeSuppress FlashMode = 2
	FlashModeAudo     FlashMode = 3
)

type FlashReturnMode

type FlashReturnMode int
const (
	FlashReturnModeDisabled FlashReturnMode = 0 // no strobe return detection
	FlashReturnModeNo       FlashReturnMode = 2 // strobe return light not detected
	FlashReturnModeYes      FlashReturnMode = 3 // strobe return light detected
)

type GPSCoord

type GPSCoord [3]xmp.Rational

func (*GPSCoord) UnmarshalText

func (x *GPSCoord) UnmarshalText(data []byte) error

unmarshal from decimal

type GainMode

type GainMode int
const (
	GainModeNone     GainMode = 0
	GainModeLowUp    GainMode = 1
	GainModeHighUp   GainMode = 2
	GainModeLowDown  GainMode = 3
	GainModeHighDown GainMode = 4
)

type InteropMode

type InteropMode string
const (
	InteropModeR98 InteropMode = "R98"
	InteropModeTHM InteropMode = "THM"
	InteropModeR03 InteropMode = "R03"
)

type LightSource

type LightSource int
const (
	LightSourceUnknown              LightSource = 0
	LightSourceDaylight             LightSource = 1
	LightSourceFluorescent          LightSource = 2
	LightSourceTungsten             LightSource = 3
	LightSourceFlash                LightSource = 4
	LightSourceFineWeather          LightSource = 9
	LightSourceCloudyWeather        LightSource = 10
	LightSourceShade                LightSource = 11
	LightSourceDaylightFluorescent  LightSource = 12 // D 5700 - 7100K
	LightSourceDayWhiteFluorescent  LightSource = 13 // N 4600 - 5500K
	LightSourceCoolWhiteFluorescent LightSource = 14 // W 3800 - 4500K
	LightSourceWhiteFluorescent     LightSource = 15 // WW 3250 - 3800K
	LightSourceWarmWhiteFluorescent LightSource = 16 // L 2600 - 3250K
	LightSourceStandardA            LightSource = 17
	LightSourceStandardB            LightSource = 18
	LightSourceStandardC            LightSource = 19
	LightSourceD55                  LightSource = 20
	LightSourceD65                  LightSource = 21
	LightSourceD75                  LightSource = 22
	LightSourceD50                  LightSource = 23
	LightSourceISOStudioTungsten    LightSource = 24
	LightSourceOther                LightSource = 255
)

type MeteringMode

type MeteringMode int
const (
	MeteringModeUnknown               MeteringMode = 0
	MeteringModeAverage               MeteringMode = 1
	MeteringModeCenterWeightedAverage MeteringMode = 2
	MeteringModeSpot                  MeteringMode = 3
	MeteringModeMultiSpot             MeteringMode = 4
	MeteringModePattern               MeteringMode = 5
	MeteringModePartial               MeteringMode = 6
	MeteringModeother                 MeteringMode = 255
)

type OECF

type OECF struct {
	Columns int               `xmp:"exif:Columns"`
	Rows    int               `xmp:"exif:Rows"`
	Names   xmp.StringArray   `xmp:"exif:Names"`
	Values  xmp.RationalArray `xmp:"exif:Values"`
}

func (*OECF) Addr

func (x *OECF) Addr() *OECF

func (OECF) IsZero

func (x OECF) IsZero() bool

func (OECF) MarshalXMP

func (x OECF) MarshalXMP(e *xmp.Encoder, node *xmp.Node, m xmp.Model) error

func (*OECF) UnmarshalText

func (x *OECF) UnmarshalText(data []byte) error

type RenderMode

type RenderMode int
const (
	RenderModeNormal RenderMode = 0
	RenderModeCustom RenderMode = 1
)

type SaturationMode

type SaturationMode int
const (
	SaturationModeNormal SaturationMode = 0
	SaturationModeLow    SaturationMode = 1
	SaturationModeHigh   SaturationMode = 2
)

type SceneCaptureType

type SceneCaptureType int
const (
	SceneCaptureTypeStandard  SceneCaptureType = 0
	SceneCaptureTypeLandscape SceneCaptureType = 1
	SceneCaptureTypePortrait  SceneCaptureType = 2
	SceneCaptureTypeNight     SceneCaptureType = 3
)

type SensingMode

type SensingMode int
const (
	SensingModeUndefined SensingMode = 1 // Not defined
	SensingModeOneChip   SensingMode = 2 // One-chip color area sensor
	SensingModeTwoChip   SensingMode = 3 // Two-chip color area sensor
	SensingModeThreeChip SensingMode = 4 // Three-chip color area sensor
	SensingModeArea      SensingMode = 5 // Color sequential area sensor
	SensingModeTrilinear SensingMode = 7 // Trilinear sensor
	SensingModeLinear    SensingMode = 8 // Color sequential linear sensor
)

type SensitivityType

type SensitivityType int
const (
	SensitivityTypeUnknown     SensitivityType = 0 // Unknown
	SensitivityTypeSOS         SensitivityType = 1 // Standard output sensitivity (SOS)
	SensitivityTypeREI         SensitivityType = 2 // Recommended exposure index (REI)
	SensitivityTypeISO         SensitivityType = 3 // ISOspeed
	SensitivityTypeSOS_REI     SensitivityType = 4 // Standard output sensitivity (SOS) and recommended exposure index (REI)
	SensitivityTypeSOS_ISO     SensitivityType = 5 // Standard output sensitivity (SOS) and ISOspeed
	SensitivityTypeREI_ISO     SensitivityType = 6 // Recommended exposure index (REI) and ISO speed
	SensitivityTypeSOS_REI_ISO SensitivityType = 7 // Standard output sensitivity (SOS) and recommended exposure index (REI) and ISO speed
)

type SharpnessMode

type SharpnessMode int
const (
	SharpnessModeNormal SharpnessMode = 0
	SharpnessModeSoft   SharpnessMode = 1
	SharpnessModeHard   SharpnessMode = 2
)

type SubjectDistanceMode

type SubjectDistanceMode int
const (
	SubjectDistanceUnknown SubjectDistanceMode = 0
	SubjectDistanceMacro   SubjectDistanceMode = 1 // macro mode
	SubjectDistanceClose   SubjectDistanceMode = 2 // 1-3 m
	SubjectDistanceDistant SubjectDistanceMode = 3 // >3m
)

type WhiteBalanceMode

type WhiteBalanceMode int
const (
	WhiteBalanceAuto   WhiteBalanceMode = 0
	WhiteBalanceManual WhiteBalanceMode = 1
)

Jump to

Keyboard shortcuts

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