imageconvert

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: GPL-3.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompressJPEG

func CompressJPEG(quality int, imagePath string)

CompressJPEG uses jpegoptim to compress the image

func Convert

func Convert(from string) (string, string)

Convert converts pngs and webps to jpeg this first string returned is the name of the new file the second string returned is the type of the input image (png, webp), as detected from its encoding, not file name

func EscapeFilePath

func EscapeFilePath(file string) string

EscapeFilePath escapes spaces in the filepath used for an exec() call

func FilerJPEG

func FilerJPEG(files []string) []string

FilterJPEG filters a slice of files to return only jpegs

func FilerJPG

func FilerJPG(files []string) []string

FilterJPG filters a slice of files to return only jpgs

func FilerPNG

func FilerPNG(files []string) []string

FilterPNG filters a slice of files to return only pngs

func FilerWEBP

func FilerWEBP(files []string) []string

FilterWEBP filters a slice of files to return only webps

func HandleErr

func HandleErr(prefix string, err error)

HandleErr is a convience func to inspect errors all errors in this app are fatal

func ListFiles

func ListFiles(root string, skipMap map[string]bool) []string

ListFiles lists every file in a directory (recursive) and optionally ignores files given in skipMap

func QualityCheck

func QualityCheck(maxQuality int, file string) bool

QualityCheck uses imagemagick to determine the quality of the image and returns true if the quality is above a given threshold

func WouldOverwrite

func WouldOverwrite(path, imageType string) bool

WouldOverwrite looks to see if the file were to be converted to a jpeg, would it overwite an existing jpg file with the same name

Types

This section is empty.

Jump to

Keyboard shortcuts

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