imagedup

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ImageExtensionRegex = regexp.MustCompile(".*.jpg$|.*.jpeg$|.*.png$|.*.webp$|.*.JPG$|.*.JPEG$|.*.PNG$|.*.WEBP$")

ImageExtensionRegex captures file extensions we can work with.

Functions

This section is empty.

Types

type ImageDup

type ImageDup struct {
	HashCache *hash.Cache
	*hash.Differ
	// contains filtered or unexported fields
}

ImageDup diffs images in order to find similar/duplicate images

func NewImageDup

func NewImageDup(promNamespace, hashCacheFile string, numWorkers, numFiles, distanceThreshold int, dedupPairs bool) (*ImageDup, error)

NewImageDup is the constructor which sets up everything for diffing but does not actually start diffing, Run() must be called for that.

func (*ImageDup) Run

func (id *ImageDup) Run(ctx context.Context, files []string) (chan hash.DiffResult, chan error)

Run starts the diff workers and feeds them files

func (*ImageDup) Shutdown

func (id *ImageDup) Shutdown() error

Shutdown unregisters prom stats and writes the image cache to disk. Context cancel must be called to kill the differ workers. See nsquared/main.go for an example

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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