files

package
v0.0.0-...-2045635 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2017 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Query is a slice of keywords used in a database query
	Query []string
	// Results is a slice of filenames of images that match the query
	Results []string
	// IgnoreCase is a boolean flag to ignore case specifiers in keyword strings
	IgnoreCase = false
)
View Source
var (
	// WALKPATH is the path to be walked during database initialization
	WALKPATH string
	// CONFDIR is the directory where program files will be stored
	CONFDIR string
	// DBFILE is the path to the file where the keyword database is stored
	DBFILE string

	// Verbose is a boolean flag toggling verbosity of *Walker functions
	Verbose = false
)
View Source
var ErrImageNotRecognized = errors.New("file: image format unrecognized")

Functions

func GWalker

func GWalker(path string, f os.FileInfo, err error) error

GWalker is an alternative to the Walker function in walker.go: it both walks the filesystem and performs the search; this is slow, but was implemented on request to run imgrep without using the preindexed database

func Grep

func Grep(preindex bool)

Grep performs the actual search by matching keywords in the database or by walking the filesystem (no-preindex) and checking each file

func InitFromPath

func InitFromPath(verbose bool) error

InitFromPath initializes the keyword database by walking the directory tree and subsequently processing images.

func IsImage

func IsImage(path string) bool

IsImage determines if a file located at the provided path is one of a JPEG, PNG, or GIF image

func Walker

func Walker(path string, f os.FileInfo, err error) error

Walker is executed when walking the file system. It checks if files are images and runs Tesseract OCR to index keywords accordingly.

Types

This section is empty.

Jump to

Keyboard shortcuts

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