Documentation ¶
Overview ¶
Package exif wraps the exiftool
Index ¶
Constants ¶
const ( // AnyVersion is used to indicate that the caller doesn't care about // which version of exiftool is installed AnyVersion = "" )
Variables ¶
var ( // ErrStop is used by TagFunc implementations to indicate that // the Walk process is completed ErrStop = errors.New("stop") )
Functions ¶
This section is empty.
Types ¶
type Description ¶
Description of a given tag
type ErrToolNotFound ¶
type ErrToolNotFound struct {
// contains filtered or unexported fields
}
ErrToolNotFound is returned if the system doesn't have the exif tool installed of if the tool is installed but the version is not valid.
type TableInfo ¶
type TableInfo struct { // Name of this table Name string `xml:"name,attr"` }
TableInfo contains information about an ExIF tag table
type Tag ¶
type Tag struct { Table TableInfo `xml:"-"` Writable bool `xml:"writable,attr"` Type string `xml:"type,attr"` Name string `xml:"name,attr"` Description []Description `xml:"desc"` }
Tag contains details about an ExIF Tag
type TagFunc ¶
TagFunc is used by WalkTags to iterate over all tags, users can return ErrStop error to indicate that they don't want to process further tags.
type Tool ¶
type Tool struct {
// contains filtered or unexported fields
}
Tool is the wrapper for exif
func Open ¶
Open the tool, the tool must be available in the OS PATH.
expectedVersion will control which version of the tool is used, callers can use AnyVersion to indicate that version information is not relevant
func (*Tool) WalkTags ¶
WalkTags from -listx calling handler for each tag processed. See TagFunc for more information.
The function will abort as soon as the first error is found, if the first error is ErrStop the error is silenced, otherwise it is passed as-is, to callers.
The operation works as a stream, so it is possible that a mal-formed XML document is partially decoded, usually this is not a concern since the underlying tool will always generate valid XMLs, but if the Context is Done before the whole XML is streamed, partial data might have been processed by handler.