Documentation ¶
Index ¶
- func CreatePathTo(s string) error
- func Exists(p string) bool
- func RemoveAccents(s string) string
- func ResizeImage(src image.Image, maxWidth int64, maxHeight int64, square bool) (image.Image, error)
- func SanitizeName(s string) string
- func SanitizeString(s string, r *regexp.Regexp) string
- func Save(r io.Reader, path string) error
- func SaveJpegRepresentations(r io.Reader, options []Options) error
- func SavePNGRepresentations(r io.Reader, options []Options) error
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreatePathTo ¶
CreatePathTo creates all directories enclosing this file path (which may not yet exist)
func Exists ¶
Exists returns true if this file exists and can be accessed for more complex requirements use os.Stat, this is a shortcut
func RemoveAccents ¶
RemoveAccents replaces a set of accented characters with ascii equivalents.
func ResizeImage ¶
func ResizeImage(src image.Image, maxWidth int64, maxHeight int64, square bool) (image.Image, error)
ResizeImage resizes the given image IF it is larger than maxWidth or maxHeight
func SanitizeName ¶
SanitizeName makes a string safe to use in a file name by first finding the path basename, then replacing non-ascii characters.
func SanitizeString ¶
SanitizeString replaces separators with - and removes characters listed in the regexp provided from string. Accents, spaces, and all characters not in A-Za-z0-9 are replaced.
func SaveJpegRepresentations ¶
SaveJpegRepresentations saves several image representation rescaled in proportion (always in proportion) using the specified max width, max height and quality