img

package
v0.0.0-...-40caa79 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// GIFMatch matches on gif files
	GIFMatch = &ImageMatch{[]string{"*.gif", "*.GIF"}}
	// JPGMatch matches jpegs
	JPGMatch = &ImageMatch{[]string{"*.jpg", "*.jpeg", "*.JPG", "*.JPEG"}}
	// PNGMatch matches png files
	PNGMatch = &ImageMatch{[]string{"*.png", "*.PNG"}}
	// TIFFMatch matches tiff files
	TIFFMatch = &ImageMatch{[]string{"*.cr2", "*.CR2", "*.tiff", "*.TIFF"}}
)

Functions

This section is empty.

Types

type FingerPrint

type FingerPrint struct {
	Hash   []byte
	Images []string
}

FingerPrint is a fingerprint and the files associated with it

type FingerPrintCollection

type FingerPrintCollection struct {
	FingerPrints []FingerPrint
}

FingerPrintCollection is a collection of fingerprints

type FingerPrinter

type FingerPrinter interface {
	FingerPrint() ([]byte, error)
}

FingerPrinter specifies a value that can generate a practically-unique fingerprint for an image

type Image

type Image struct {
	Path     string
	Type     string
	Config   image.Config
	FileInfo os.FileInfo
}

Image represents an image file

func NewImage

func NewImage(path string) (*Image, error)

NewImage creates a new Image

func (*Image) FingerPrint

func (i *Image) FingerPrint() ([]byte, error)

FingerPrint returns a unique fingerprint for an image - well... for practical purposes

func (*Image) Height

func (i *Image) Height() uint64

Height returns the height of the image

func (*Image) HeightByteSlice

func (i *Image) HeightByteSlice() []byte

HeightByteSlice returns the size of the image in a byte array

func (*Image) Size

func (i *Image) Size() uint64

Size returns the size

func (*Image) SizeByteSlice

func (i *Image) SizeByteSlice() []byte

SizeByteSlice returns the size of the image in a byte array

func (*Image) Width

func (i *Image) Width() uint64

Width returns the width of the image

func (*Image) WidthByteSlice

func (i *Image) WidthByteSlice() []byte

WidthByteSlice returns the size of the image in a byte array

type ImageMatch

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

ImageMatch matches typical image files

func NewImageMatch

func NewImageMatch(patterns []string) *ImageMatch

NewImageMatch creates a new ImageMatch

func (*ImageMatch) Patterns

func (i *ImageMatch) Patterns() []string

Patterns returns the patters for this Matcher

Jump to

Keyboard shortcuts

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