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

Method Run

processing/pipeline.go:75–97  ·  view source on GitHub ↗

Run runs the given pipeline with the given parameters

(
	ctx context.Context,
	img *vips.Image,
	po ProcessingOptions,
	imgdata imagedata.ImageData,
)

Source from the content-addressed store, hash-verified

73
74// Run runs the given pipeline with the given parameters
75func (p Pipeline) Run(
76 ctx context.Context,
77 img *vips.Image,
78 po ProcessingOptions,
79 imgdata imagedata.ImageData,
80) error {
81 pctx := p.newContext(ctx, img, po, imgdata)
82 pctx.CalcParams()
83
84 for _, step := range p {
85 if err := step(&pctx); err != nil {
86 return err
87 }
88
89 if err := server.CheckTimeout(ctx); err != nil {
90 return err
91 }
92 }
93
94 img.SetDouble("imgproxy-dpr-scale", pctx.DprScale)
95
96 return nil
97}
98
99func (p Pipeline) newContext(
100 ctx context.Context,

Callers 15

TestRoundTripperFunction · 0.80
TestVerifySourceNetworkFunction · 0.80
TestSignatureFunction · 0.80
TestCopyAllFunction · 0.80
TestBufferedReaderFunction · 0.80
TestSyslogConfigLevelFunction · 0.80
TestLevelMethod · 0.80
TestGroupsMethod · 0.80

Calls 4

newContextMethod · 0.95
CheckTimeoutFunction · 0.92
CalcParamsMethod · 0.80
SetDoubleMethod · 0.80

Tested by 15

TestRoundTripperFunction · 0.64
TestVerifySourceNetworkFunction · 0.64
TestSignatureFunction · 0.64
TestCopyAllFunction · 0.64
TestBufferedReaderFunction · 0.64
TestSyslogConfigLevelFunction · 0.64
TestLevelMethod · 0.64
TestGroupsMethod · 0.64