Exemplo n.º 1
0
Arquivo: convert.go Projeto: phzfi/RIC
func (c Convert) Apply(img images.Image) error {
	logging.Debug(fmt.Sprintf("Converting image to: %v", c.Format))
	return img.Convert(c.Format)
}
Exemplo n.º 2
0
Arquivo: resize.go Projeto: phzfi/RIC
func (r Resize) Apply(img images.Image) error {
	logging.Debug("Resizing image to: %v, %v", r.Width, r.Height)
	return img.Resize(r.Width, r.Height)
}
Exemplo n.º 3
0
func (w watermark) Apply(img images.Image) (err error) {
	logging.Debug("Adding watermark")
	return img.Watermark(w.stamp, w.horizontal, w.vertical)
}
Exemplo n.º 4
0
func (r LiquidRescale) Apply(img images.Image) error {
	logging.Debugf("Liquid rescaling image to: %v, %v", r.Width, r.Height)
	// The third argument to LiquidRescaleImage is the maximum transversal step, or how many pixels a seam can move sideways.
	// The fourth is the rigidity, which makes seams less steep. Recommended if transversal step is greater than one.
	return img.LiquidRescaleImage(uint(r.Width), uint(r.Height), 1, 0)
}
Exemplo n.º 5
0
Arquivo: crop.go Projeto: phzfi/RIC
func (c Crop) Apply(img images.Image) error {
	logging.Debugf("Crop image to: %d, %d with offset: %d, %d", c.Width, c.Height, c.X, c.Y)
	return img.Crop(c.Width, c.Height, c.X, c.Y)
}