Documentation ¶
Index ¶
- func CompressJPEG(quality int, imagePath string) (bool, string, error)
- func Convert(inputFile string) (string, string, error)
- func EscapeFilePath(file string) string
- func QualityCheck(maxQuality int, imagePath string) (bool, error)
- func Resize(filename string, resizeWidthThreshold, resizeHeightThreshold int, ...) (bool, error)
- func WouldOverwrite(path string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompressJPEG ¶
CompressJPEG uses jpegoptim to compress the image. Return values: 1. was it compressed? jpegoptim may not be able to compress it any further 2. jpegoptim output (if you want to log it) 3. error
func Convert ¶
Convert converts pngs and webps to jpeg, if successful the inputFile is deleted. 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 ¶
EscapeFilePath escapes spaces in the filepath used for an exec() call.
func QualityCheck ¶
QualityCheck uses imagemagick to determine the quality of the image and returns true if the quality is above a given threshold
func WouldOverwrite ¶
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.