index

package
v0.0.0-...-de9107d Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotDirectory = errors.New("file is not directory")
)

Functions

This section is empty.

Types

type Index

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

func NewEmptyIndex

func NewEmptyIndex() *Index

func NewIndex

func NewIndex(dir string) (*Index, error)

func (*Index) Add

func (idx *Index) Add(fullPath string)

func (*Index) Directory

func (idx *Index) Directory() string

func (*Index) Get

func (idx *Index) Get(fullPath string) *Medium

func (*Index) GetMediaBySize

func (idx *Index) GetMediaBySize() map[int64]Media

func (*Index) LoadMeta

func (idx *Index) LoadMeta() error

func (*Index) Same

func (idx *Index) Same(medium *Medium) *Medium

func (*Index) Size

func (idx *Index) Size() int

func (*Index) Walk

func (idx *Index) Walk(dir string, ignored map[string]bool) error

type Media

type Media []*Medium

func (Media) Same

func (media Media) Same(medium *Medium) *Medium

type Medium

type Medium struct {

	//
	//ShootingTime     time.Time
	//ShootingTimeUnix int64
	Adler32  uint32
	SHA256   []byte
	FullPath string
	os.FileInfo
	// contains filtered or unexported fields
}

func NewMedium

func NewMedium(filename string) *Medium

func (*Medium) Meta

func (m *Medium) Meta() *Meta

func (*Medium) PHash

func (m *Medium) PHash() error

func (*Medium) Same

func (m *Medium) Same(other *Medium) bool

func (*Medium) ShootingTime

func (m *Medium) ShootingTime() int64

func (*Medium) SumAdler32

func (m *Medium) SumAdler32()

func (*Medium) SumSHA256

func (m *Medium) SumSHA256()

func (*Medium) Valid

func (m *Medium) Valid() bool

type Meta

type Meta struct {
	SourceFile string `json:SourceFile`
	//Directory      string `json:"File:Directory"`
	FileModifyDate int64 `json:"File:FileModifyDate"` // third
	FileCreateDate int64 `json:"File:FileCreateDate"` // third
	//FileName       string `json:"File:FileName"`
	FileType    string `json:"File:FileType"`
	ImageHeight int64  `json:"File:ImageHeight"`
	ImageWidth  int64  `json:"File:ImageWidth"`
	MIMEType    string `json:"File:MIMEType"`

	EXIFCreateDate       int64  `json:"EXIF:CreateDate"` // second
	EXIFModifyDate       int64  `json:"EXIF:ModifyDate"`
	DateTimeOriginal     int64  `json:"EXIF:DateTimeOriginal"`     // first
	Model                string `json:"EXIF:Model"`                //  camera model
	H264DateTimeOriginal int64  `json:"H264:DateTimeOriginal"`     // DateTime for h264
	QTDateTime           int64  `json:"QuickTime:MediaCreateDate"` // DateTime for QuickTime
	XMPPhotoId           string `json:"XMP:PhotoId"`

	GPSLatitude  string `json:"Composite:GPSLatitude"`
	GPSLongitude string `json:"Composite:GPSLongitude"`

	// ExifTool Error
	ExifToolError   string `json:"ExifTool:Error"`
	ExifToolWarning string `json:"ExifTool:Warning"`
}

Jump to

Keyboard shortcuts

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