Documentation ¶
Overview ¶
Package courgette contains everything necessary to manage a bunch of photos using their metadata. Useful if you organize your picture with a different folder for each month.
Index ¶
- type Collection
- func (c *Collection) AnalyzeContents(subdir string) (numFiles int, err error)
- func (c *Collection) GetSubDir(subdir string) (SubDirectory, error)
- func (c *Collection) Import(from string) (numImported int, err error)
- func (c *Collection) Refresh(subdir string) (numRenamed int, err error)
- func (c *Collection) SortNew() (numSorted int, err error)
- type Config
- type Picture
- func (p *Picture) Analyze(c Collection) (err error)
- func (p *Picture) ComputeHash() (err error)
- func (p *Picture) ConvertToBW() (err error)
- func (p *Picture) Diff(otherP Picture) (isSame bool, diffText string, err error)
- func (p *Picture) IsNew(c Config) (isNew bool)
- func (p *Picture) Rename(c Collection) (wasRenamed bool, err error)
- func (p *Picture) Rotate() (err error)
- type Pictures
- type SubDirectory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Collection struct { Config Contents []SubDirectory }
Collection represents a collection of Pictures
func (*Collection) AnalyzeContents ¶
func (c *Collection) AnalyzeContents(subdir string) (numFiles int, err error)
AnalyzeContents of a given subdirectory.
func (*Collection) GetSubDir ¶
func (c *Collection) GetSubDir(subdir string) (SubDirectory, error)
GetSubDir returns the SubDirectory from its name
func (*Collection) Import ¶
func (c *Collection) Import(from string) (numImported int, err error)
Import from card.
func (*Collection) Refresh ¶
func (c *Collection) Refresh(subdir string) (numRenamed int, err error)
Refresh filenames in a given subdirectory.
func (*Collection) SortNew ¶
func (c *Collection) SortNew() (numSorted int, err error)
SortNew Pictures in the incoming directory.
type Config ¶
type Config struct { Root string Incoming string Cameras map[string]string Lenses map[string]string NameFormat string GroupBy string // month, year, other?? }
Config holds all input necessary to deal with a Collection
func (*Config) CheckValidCardReader ¶
CheckValidCardReader makes sure the card is mounted and exists.
type Picture ¶
type Picture struct { goexiftool.MediaFile // TODO instead of Parent, subdir ie filepath.Rel(root, parent(filename)) Parent string NewFilename string Hash string IsBW bool Number int Version int FormattedDate string ID string Camera string Lens string Extension string Analyzed bool }
Picture can manipulate a picture file.
func NewPicture ¶
func NewPicture(filename string, isBW bool, number int, version int, id string, extension string) (p *Picture, err error)
NewPicture initializes a Picture and parses its metadata with exiftool.
func (*Picture) Analyze ¶
func (p *Picture) Analyze(c Collection) (err error)
Analyze a Picture to get its metadata and filename information.
func (*Picture) ComputeHash ¶
ComputeHash calculates the hash of the Picture file.
func (*Picture) ConvertToBW ¶
ConvertToBW a color Picture.
type Pictures ¶
type Pictures []Picture
Pictures is a list of Pictures.
type SubDirectory ¶
type SubDirectory struct { Name string Jpgs Pictures BwJpgs Pictures RawFiles Pictures Analyzed bool }
SubDirectory contains JPGs, B/W JPGs, and raw files.
func (*SubDirectory) Analyze ¶
func (s *SubDirectory) Analyze(c Collection) (numFiles int, err error)
Analyze of a given subdirectory.
func (*SubDirectory) FindOrphans ¶
func (s *SubDirectory) FindOrphans(c Collection) (orphans Pictures, err error)
FindOrphans in a given subdirectory