api

package
v0.0.0-...-1f36970 Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: BSD-2-Clause Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// GPSIfd "IFD/GPS"
	GPSIfdString = "IFD/GPS"
)

GPS API constants

Variables

View Source
var (
	ErrEmptyTag = errors.New("Error empty tag")
	ErrParseTag = fmt.Errorf("Error parsing tag")
	ErrTagType  = errors.New("Error wrong tag Type")
)

API Errors

View Source
var (
	// ErrGpsCoordsNotValid means that some part of the geographic data were unparseable.
	ErrGpsCoordsNotValid = errors.New("GPS coordinates not valid")
	// ErrGPSRationalNotValid means that the rawCoordinates were not long enough.
	ErrGPSRationalNotValid = errors.New("GPS Coords requires a raw-coordinate with exactly three rationals")
)
View Source
var (
	ErrParseYear  = fmt.Errorf("Error parsing Year")
	ErrParseMonth = fmt.Errorf("Error parsing Month")
	ErrParseDay   = fmt.Errorf("Error parsing Day")
	ErrParseHour  = fmt.Errorf("Error parsing Hour")
	ErrParseMin   = fmt.Errorf("Error parsing Min")
)

Errors for Parsing of Time

Functions

func NewTagMap

func NewTagMap() exif.TagMap

NewTagMap - initialize each TagMap with allocations for 10 Tags

Types

type CanonAFInfo

type CanonAFInfo struct {
	AFAreaMode    ifdmknote.CanonAFAreaMode
	NumAFPoints   uint16
	ValidAFPoints uint16
	AFPoints      []ifdmknote.AFPoint
	InFocus       []int
	Selected      []int
}

CanonAFInfo - Canon Makernote Autofocus Information

type CanonCameraSettings

type CanonCameraSettings struct {
	Macromode         bool                           // [1]
	SelfTimer         bool                           // [2]
	ContinuousDrive   ifdmknote.CanonContinuousDrive // [5]
	FocusMode         ifdmknote.CanonFocusMode       // [7]
	MeteringMode      ifdmknote.CanonMeteringMode    // [17]
	FocusRange        ifdmknote.CanonFocusRange      // [18]
	CanonExposureMode ifdmknote.CanonExposureMode    // [20]
	MaxFocalLength    int16                          // [23]
	MinFocalLength    int16                          // [24]
	//FocalUnits        int16                       // [25]
	//FocusContinuous   ifdmknote.CanonFocusContinous  // [32]
	//SpotMeteringMode  bool                        // [39]
	AESetting ifdmknote.CanonAESetting // [33]
}

CanonCameraSettings - Canon Makernote Camera Settings Incomplete

type CanonFileInfo

type CanonFileInfo struct {
	FocusDistance     ifdmknote.FocusDistance    // 20 	FocusDistanceUpper 	int16u // 21 	FocusDistanceLower 	int16u
	BracketMode       ifdmknote.CanonBracketMode // 3 	BracketMode 	int16s
	BracketValue      int16                      // 4 	BracketValue 	int16s
	BracketShotNumber int16                      // 5 	BracketShotNumber 	int16s
	LiveViewShooting  bool                       // 19 	LiveViewShooting 	int16s (bool)
}

CanonFileInfo - Canon Makernote File Information

type CanonShotInfo

type CanonShotInfo struct {
	CameraTemperature      int16 // [12] 	CameraTemperature 	int16s 	(newer EOS models only)
	FlashExposureComp      int16 // [15] 	FlashExposureComp 	int16s
	AutoExposureBracketing int16 // [16] 	AutoExposureBracketing 	int16s
	AEBBracketValue        int16 // [17] 	AEBBracketValue 	int16s
	SelfTimer              int16 // 29 	SelfTimer2 	int16s

}

CanonShotInfo - Canon Makernote Shot Information WIP / Incomplete

type ExifResults

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

ExifResults contains an exifReader, the tags and offsets for parsing the values from the exifReader

func NewExifResults

func NewExifResults(er *exiftool.ExifReader) ExifResults

NewExifResults creates a new ExifResults with an active ExifReader. The ByteOrder is taken from the ExifReader

func (ExifResults) AddTag

func (itm ExifResults) AddTag(tag exif.Tag, ifdIndex int8, fqIfdPath string, tagID exif.TagID)

AddTag adds a Tag to the ExifResults

func (ExifResults) Aperture

func (res ExifResults) Aperture() (float32, error)

Aperture convenience func. "IFD/Exif" FNumber

func (ExifResults) Artist

func (res ExifResults) Artist() (artist string, err error)

Artist convenience func. "IFD" Artist

func (ExifResults) CameraMake

func (res ExifResults) CameraMake() (make string, err error)

CameraMake convenience func. "IFD" Make

func (ExifResults) CameraModel

func (res ExifResults) CameraModel() (model string, err error)

CameraModel convenience func. "IFD" Model

func (ExifResults) CameraSerial

func (res ExifResults) CameraSerial() (serial string, err error)

CameraSerial convenience func. "IFD/Exif" BodySerialNumber

func (ExifResults) CanonAFInfo

func (res ExifResults) CanonAFInfo() (afInfo CanonAFInfo, err error)

CanonAFInfo - Canon Camera AutoFocus Information from the Makernote

func (ExifResults) CanonCameraSettings

func (res ExifResults) CanonCameraSettings() (CanonCameraSettings, error)

CanonCameraSettings convenience func. "IFD/Exif/Makernotes.Canon" CanonCameraSettings Canon Camera Settings from the Makernote

func (ExifResults) CanonFileInfo

func (res ExifResults) CanonFileInfo() (CanonFileInfo, error)

CanonFileInfo convenience func. "IFD/Exif/Makernotes.Canon" CanonFileInfo Canon Camera File Info from the Makernote

func (ExifResults) CanonShotInfo

func (res ExifResults) CanonShotInfo() (CanonShotInfo, error)

CanonShotInfo convenience func. "IFD/Exif/Makernotes.Canon" CanonShotInfo Canon Camera Shot Info from the Makernote

func (ExifResults) Copyright

func (res ExifResults) Copyright() (copyright string, err error)

Copyright convenience func. "IFD" Copyright

func (ExifResults) DateTime

func (res ExifResults) DateTime() (time.Time, error)

DateTime - the date and time at which the EXIF file was created with sub-second precision

func (ExifResults) Dimensions

func (res ExifResults) Dimensions() (width, height int, err error)

Dimensions convenience func. "IFD" Dimensions

func (ExifResults) ExposureBiasValue

func (res ExifResults) ExposureBiasValue() (string, error)

ExposureBiasValue convenience func. "IFD/Exif" ExposureBiasValue WIP

func (ExifResults) ExposureProgram

func (res ExifResults) ExposureProgram() (ExposureMode, error)

ExposureProgram convenience func. "IFD/Exif" ExposureProgram

func (ExifResults) Flash

func (res ExifResults) Flash() (FlashMode, error)

Flash convenience func. "IFD/Exif" Flash

func (ExifResults) FocalLength

func (res ExifResults) FocalLength() (FocalLength, error)

FocalLength convenience func. "IFD/Exif" FocalLength Lens Focal Length in mm

func (ExifResults) FocalLengthIn35mmFilm

func (res ExifResults) FocalLengthIn35mmFilm() (FocalLength, error)

FocalLengthIn35mmFilm convenience func. "IFD/Exif" FocalLengthIn35mmFilm Lens Focal Length Equivalent for 35mm sensor in mm

func (ExifResults) GPSAltitude

func (res ExifResults) GPSAltitude() (alt float32, err error)

GPSAltitude convenience func. "IFD/GPS" GPSAltitude WIP

func (ExifResults) GPSInfo

func (res ExifResults) GPSInfo() (lat, lng float64, err error)

GPSInfo convenience func. "IFD/GPS" GPSLatitude and GPSLongitude

func (ExifResults) GPSTime

func (res ExifResults) GPSTime() (timestamp time.Time, err error)

GPSTime convenience func. "IFD/GPS" GPSDateStamp and GPSTimeStamp

func (ExifResults) GetIfd

func (itm ExifResults) GetIfd(fqIfdPath string) []exif.TagMap

GetIfd returns an Ifd of Tags from the ExifResults

func (ExifResults) GetTag

func (itm ExifResults) GetTag(fqIfdPath string, ifdIndex int8, tagID exif.TagID) exif.Tag

GetTag returns a Tag from the ExifResults

func (ExifResults) ISOSpeed

func (res ExifResults) ISOSpeed() (int, error)

ISOSpeed convenience func. "IFD/Exif" ISOSpeed

func (ExifResults) LensMake

func (res ExifResults) LensMake() (make string, err error)

LensMake convenience func. "IFD/Exif" LensMake

func (ExifResults) LensModel

func (res ExifResults) LensModel() (model string, err error)

LensModel convenience func. "IFD/Exif" LensModel

func (ExifResults) LensSerial

func (res ExifResults) LensSerial() (serial string, err error)

LensSerial convenience func. "IFD/Exif" LensSerialNumber

func (ExifResults) MeteringMode

func (res ExifResults) MeteringMode() (MeteringMode, error)

MeteringMode convenience func. "IFD/Exif" MeteringMode

func (ExifResults) ModifyDate

func (res ExifResults) ModifyDate() (time.Time, error)

ModifyDate - the date and time at which the Exif file was modified

func (ExifResults) Orientation

func (res ExifResults) Orientation() (string, error)

Orientation convenience func. "IFD" Orientation WIP

func (ExifResults) ShutterSpeed

func (res ExifResults) ShutterSpeed() (ShutterSpeed, error)

ShutterSpeed convenience func. "IFD/Exif" ExposureTime

func (ExifResults) String

func (itm ExifResults) String() string

func (ExifResults) Thumbnail

func (res ExifResults) Thumbnail() (int, int, error)

Thumbnail convenience func. "IFD0" StripOffsets and StripByteCounts WIP Errors with NEF images

func (ExifResults) XMLPacket

func (res ExifResults) XMLPacket() (str string, err error)

XMLPacket convenience func. "IFD" XMLPacket WIP

type ExposureBias

type ExposureBias [2]int64

ExposureBias - [0] Numerator [1] Denominator

func (ExposureBias) MarshalJSON

func (eb ExposureBias) MarshalJSON() ([]byte, error)

MarshalJSON - Custom Marshall JSON

func (ExposureBias) String

func (eb ExposureBias) String() string

String - String value of Exposure Bias

type ExposureMode

type ExposureMode uint8

ExposureMode - Mode in which the Exposure was taken.

func (ExposureMode) String

func (em ExposureMode) String() string

String - Return Exposure Mode as a string

type FlashMode

type FlashMode uint8

FlashMode - Mode in which a Flash was used. (uint8) - value of FlashMode

func (FlashMode) Bool

func (fm FlashMode) Bool() bool

Bool - Returns true if Flash was fired

func (FlashMode) String

func (fm FlashMode) String() string

String - Return string for FlashMode

type FocalLength

type FocalLength float32

FocalLength - Focal Length in which the image was captured

func (FocalLength) String

func (fl FocalLength) String() string

type GpsInfo

type GpsInfo struct {
	Latitude, Longitude float64
	Altitude            int
	Timestamp           time.Time
}

GpsInfo encapsulates all of the geographic information in one place.

func (*GpsInfo) S2CellID

func (gi *GpsInfo) S2CellID() (cellID s2.CellID, err error)

S2CellID returns the cell-ID of the geographic location on the earth.

func (*GpsInfo) String

func (gi *GpsInfo) String() string

String returns a descriptive string.

type MeteringMode

type MeteringMode uint8

MeteringMode - Mode in which the image was metered.

func (MeteringMode) String

func (mm MeteringMode) String() string

String - Return Metering Mode as a string

type ShutterSpeed

type ShutterSpeed [2]int

ShutterSpeed - [0] Numerator [1] Denominator

func (ShutterSpeed) MarshalJSON

func (ss ShutterSpeed) MarshalJSON() ([]byte, error)

MarshalJSON - Custom Marshall JSON

func (ShutterSpeed) String

func (ss ShutterSpeed) String() string

String - return a ShutterSpeed as a string

Jump to

Keyboard shortcuts

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