Пример #1
0
func (c Convert) Apply(img images.Image) error {
	logging.Debug(fmt.Sprintf("Converting image to: %v", c.Format))
	return img.Convert(c.Format)
}
Пример #2
0
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)
}
Пример #3
0
func (w watermark) Apply(img images.Image) (err error) {
	logging.Debug("Adding watermark")
	return img.Watermark(w.stamp, w.horizontal, w.vertical)
}
Пример #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)
}
Пример #5
0
Файл: crop.go Проект: 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)
}