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

Method Process

processing/svg/svg.go:34–47  ·  view source on GitHub ↗

Process processes the given image data

(o *options.Options, data imagedata.ImageData)

Source from the content-addressed store, hash-verified

32
33// Process processes the given image data
34func (p *Processor) Process(o *options.Options, data imagedata.ImageData) (imagedata.ImageData, error) {
35 if data.Format() != imagetype.SVG {
36 return data, nil
37 }
38
39 var err error
40
41 data, err = p.sanitize(data)
42 if err != nil {
43 return data, err
44 }
45
46 return data, nil
47}
48
49// sanitize sanitizes the SVG data.
50// It strips <script> and unsafe attributes (on* events).

Callers 4

TestSkipProcessingSVGMethod · 0.80
TestSanitizeMethod · 0.80
BenchmarkSvgProcessingFunction · 0.80

Calls 2

sanitizeMethod · 0.95
FormatMethod · 0.65

Tested by 3

TestSkipProcessingSVGMethod · 0.64
TestSanitizeMethod · 0.64
BenchmarkSvgProcessingFunction · 0.64