wallsort

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2016 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitDirectory

func InitDirectory() error

Check, if the specified directory exists, if the user has appropriate access rights, and create the the specified subfolders if necessary.

func Initialize

func Initialize() error

func MoveImages

func MoveImages() error

func ReadConfiguration

func ReadConfiguration() error

func SetBaseDirectory

func SetBaseDirectory(basedir string)

func SetDefaultConfiguration

func SetDefaultConfiguration(config *Configuration, basedir string)

func SortImages

func SortImages(imageList []Image)

func WriteConfiguration

func WriteConfiguration(configFile string) error

Types

type Category

type Category struct {
	Name      string `mapstructure:"name"`
	Heights   []int  `mapstructure:"heights"`
	Widths    []int  `mapstructure:"widths"`
	Height    int    `mapstructure:"height"`
	Width     int    `mapstructure:"width"`
	MinHeight int    `mapstructure:"min_height"`
	MinWidth  int    `mapstructure:"min_width"`
	MaxHeight int    `mapstructure:"max_height"`
	MaxWidth  int    `mapstructure:"max_width"`
	MinPixels int    `mapstructure:"min_pixels"`
	MaxPixels int    `mapstructure:"max_pixels"`

	// The filenames in the base directory, which belong into this category.
	Filenames []string
}

func (*Category) Match

func (cat *Category) Match(img Image) bool

Return true, if the image description img fullfills all the properties of the category cat, otherwise false.

type Configuration

type Configuration struct {
	Directory  string     `mapstructure:"directory"`
	Categories []Category `mapstructure:"category"`
}
var Config Configuration

type Image

type Image struct {
	Filename string
	Height   int
	Width    int
}

func GenerateImageList

func GenerateImageList() ([]Image, error)

Jump to

Keyboard shortcuts

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