exiftool

package module
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: MIT Imports: 7 Imported by: 1

README

A thin wrapper around ExifTool

PkgGoDev

This uses the excellent ExifTool by Phil Harvey:

dist_unix.sh and dist_windows.sh build minimal, self-contained distros of ExifTool for both Unix (Linux/macOS/etc) and Windows. Use Git BASH to run the Windows script.

The Windows version uses Strawberry Perl:

Documentation

Overview

Package exiftool provides a thin wrapper around ExifTool.

Index

Constants

This section is empty.

Variables

View Source
var (
	Exec   string = "exiftool" // Application to execute.
	Arg1   string              // Optional first argument.
	Config string              // ExifTool config file to use.
)

Configure ExifTool.

Functions

func Command

func Command(stdin io.Reader, arg ...string) (stdout []byte, err error)

Command runs an ExifTool command with the given arguments and stdin and returns its stdout.

func CommandContext added in v0.3.0

func CommandContext(ctx context.Context, stdin io.Reader, arg ...string) (stdout []byte, err error)

CommandContext is like Command but includes a context.

func Unmarshal

func Unmarshal(data []byte, m map[string][]byte) error

Unmarshal parses the standard, short or veryShort ExifTool output formats. Loads tag names and values into a map.

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 NewServer

func NewServer(commonArg ...string) (*Server, error)

NewServer loads a new instance of ExifTool.

func (*Server) Close

func (e *Server) Close() error

Close causes ExifTool to exit immediately. Close does not wait until ExifTool has actually exited.

func (*Server) Command

func (e *Server) Command(arg ...string) ([]byte, error)

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) Shutdown

func (e *Server) Shutdown() error

Shutdown gracefully shuts down ExifTool without interrupting any commands, and waits for it to complete.

Jump to

Keyboard shortcuts

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