utils

package
v0.0.0-...-3501fbf Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HtmlImage    = "HtmlImage"
	ArticleThumb = "ArticleThumb"
)

Variables

View Source
var ConfigImageProcessor = map[string]ImageProcessor{
	HtmlImage:    ImageProcessor{600, 0, "processImage"},
	ArticleThumb: ImageProcessor{300, 200, "MustProcessImage"},
}

Functions

func ImageThumbnail

func ImageThumbnail(file string, width uint, height uint, to string) error

func MustProcessImage

func MustProcessImage(imageName string)

func ReadFileToArray

func ReadFileToArray(path string) (cnf []interface{}, err error)

ReadYmlReader Read yaml file to arr. if json like, use json package, unless goyaml2 package.

Types

type ImageProcessor

type ImageProcessor struct {
	Width          int
	Height         int
	ImageProcessor string
}

Jump to

Keyboard shortcuts

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