Documentation
¶
Overview ¶
Package exiftool provides a thin wrapper around ExifTool.
Index ¶
- Variables
- func Command(stdin io.Reader, arg ...string) (stdout []byte, err error)
- func CommandContext(ctx context.Context, stdin io.Reader, arg ...string) (stdout []byte, err error)
- func DefaultSplitter(data []byte, atEOF bool) (advance int, token []byte, err error)
- func Unmarshal(data []byte, m map[string][]byte) error
- type Server
Constants ¶
This section is empty.
Variables ¶
var ( Exec string = "exiftool" // Application to execute. Arg1 string // Optional first argument. Config string // ExifTool config file to use. )
Configure ExifTool.
var ErrTimeout = errors.New("exiftool: command timed out")
ErrTimeout is returned by Command when ExifTool does not answer within the timeout set by SetTimeout. The ExifTool process is restarted.
Functions ¶
func Command ¶
Command runs an ExifTool command with the given arguments and stdin and returns its stdout.
func CommandContext ¶
CommandContext is like Command but includes a context.
func DefaultSplitter ¶
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server wraps an instance of ExifTool that can process multiple commands sequentially. Servers avoid the overhead of loading ExifTool for each command. Servers are safe for concurrent use by multiple goroutines.
func NewServerCh ¶
func NewServerCh(chout chan<- string, splitFunc bufio.SplitFunc, commonArg ...string) (*Server, error)
NewServerCh loads a new instance of ExifTool with output to channel file by file.
func (*Server) Close ¶
Close causes ExifTool to exit immediately and waits until the process is reaped.
func (*Server) Command ¶
Command runs an ExifTool command with the given arguments and returns its stdout. Commands should neither read from stdin, nor write binary data to stdout.
func (*Server) CommandCh ¶
Command runs an ExifTool command with the given arguments and put its stdout to channel. Commands should neither read from stdin, nor write binary data to stdout.
func (*Server) SetTimeout ¶ added in v0.5.1
SetTimeout limits how long a single Command may take; 0 (the default) means no limit. On timeout the ExifTool process is killed and restarted and Command returns ErrTimeout, so one broken file cannot block the server forever.