MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / applyFilters

Method applyFilters

processing/apply_filters.go:3–25  ·  view source on GitHub ↗
(c *Context)

Source from the content-addressed store, hash-verified

1package processing
2
3func (p *Processor) applyFilters(c *Context) error {
4 blur := c.PO.Blur()
5 sharpen := c.PO.Sharpen()
6 pixelate := c.PO.Pixelate()
7
8 if blur == 0 && sharpen == 0 && pixelate <= 1 {
9 return nil
10 }
11
12 if err := c.Img.CopyMemory(); err != nil {
13 return err
14 }
15
16 if err := c.Img.RgbColourspace(); err != nil {
17 return err
18 }
19
20 if err := c.Img.ApplyFilters(blur, sharpen, pixelate); err != nil {
21 return err
22 }
23
24 return c.Img.CopyMemory()
25}

Callers

nothing calls this directly

Calls 6

BlurMethod · 0.80
SharpenMethod · 0.80
PixelateMethod · 0.80
CopyMemoryMethod · 0.80
RgbColourspaceMethod · 0.80
ApplyFiltersMethod · 0.80

Tested by

no test coverage detected