func (c Convert) Apply(img images.Image) error { logging.Debug(fmt.Sprintf("Converting image to: %v", c.Format)) return img.Convert(c.Format) }
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) }
func (w watermark) Apply(img images.Image) (err error) { logging.Debug("Adding watermark") return img.Watermark(w.stamp, w.horizontal, w.vertical) }
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) }
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) }