imageconvert

package
v2.7.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompressJPEG

func CompressJPEG(quality int, imagePath string) (bool, string, error)

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

func Convert(inputFile string) (string, string, error)

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

func EscapeFilePath(file string) string

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

func QualityCheck

func QualityCheck(maxQuality int, imagePath string) (bool, error)

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

func Resize added in v2.7.0

func Resize(filename string, resizeWidthThreshold, resizeHeightThreshold int, resizeWidth, resizeHeight uint) (bool, error)

func WouldOverwrite

func WouldOverwrite(path 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