util

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// size of partial square for down-sampling
	// before getting slice of lab data
	DATA_SIZE = 10
)

Variables

This section is empty.

Functions

func CleanStr

func CleanStr(s string) string

func ExifCp

func ExifCp(toolPath string, src, dst string) (string, error)

ExifCp copies exif data from src image to dst image. It excludes Orientation tag because the orientation has been normalized in the processed images.

func ExifTags

func ExifTags() map[string]string

YYYY:MM:DD HH:MM:SS

func ExiftoolPath

func ExiftoolPath(toolPath string) (myPath string, err error)

func ExiftoolPathFind

func ExiftoolPathFind() (myPath string, err error)

ExiftoolPathFind searches PATH for exiftool and returns the absolute path to it if found.

func ExiftoolPathValidate

func ExiftoolPathValidate(toolPath string) (myPath string, err error)

ExiftoolPathValidate validates the provided path to exiftool exists, and if so, returns the absolute path to it.

func FillAspect

func FillAspect(img *image.Image, aspect *model.Aspect) *image.Image

func FixOrientation

func FixOrientation(img *image.Image, orientation int) error

FixOrientation modifies image in-place to match exif orientation data http://sylvana.net/jpegcrop/exif_orientation.html

func GetAspectLab

func GetAspectLab(i model.Image, aspect *model.Aspect) ([]*model.Lab, error)

func GetImageCoverPartial

func GetImageCoverPartial(i model.Image, coverPartial *model.CoverPartial) (*image.Image, error)

func GetImgAspectLab

func GetImgAspectLab(img *image.Image, i model.Image, aspect *model.Aspect) []*model.Lab

func GetImgAvgDist

func GetImgAvgDist(img *image.Image, coverPartial *model.CoverPartial) float64

func GetImgCoverPartial

func GetImgCoverPartial(img *image.Image, coverPartial *model.CoverPartial) *image.Image

func GetImgPartialLab

func GetImgPartialLab(img *image.Image, coverPartial *model.CoverPartial) []*model.Lab

func GetOrientation

func GetOrientation(path string) (int, error)

func GetPartialLab

func GetPartialLab(i model.Image, coverPartial *model.CoverPartial) ([]*model.Lab, error)

func LabAvg

func LabAvg(labs []*model.Lab) *model.Lab

func Md5sum

func Md5sum(path string) (string, error)

func NextAvailableFilename

func NextAvailableFilename(myPath string) (string, error)

func OpenImage

func OpenImage(path string) (*image.Image, error)

func OpenImg

func OpenImg(i model.Image) (*image.Image, error)

func Round

func Round(f float64) int

func SliceContainsInt64

func SliceContainsInt64(s []int64, a int64) bool

func SliceContainsString

func SliceContainsString(s []string, a string) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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