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

Method newContext

processing/pipeline.go:99–126  ·  view source on GitHub ↗
(
	ctx context.Context,
	img *vips.Image,
	po ProcessingOptions,
	imgdata imagedata.ImageData,
)

Source from the content-addressed store, hash-verified

97}
98
99func (p Pipeline) newContext(
100 ctx context.Context,
101 img *vips.Image,
102 po ProcessingOptions,
103 imgdata imagedata.ImageData,
104) Context {
105 pctx := Context{
106 Ctx: ctx,
107 Img: img,
108 PO: po,
109 ImgData: imgdata,
110
111 WScale: 1.0,
112 HScale: 1.0,
113
114 DprScale: 1.0,
115 VectorBaseShrink: 1.0,
116
117 CropGravity: po.CropGravity(),
118 }
119
120 // If crop gravity is not set, use the general gravity option
121 if pctx.CropGravity.Type == GravityUnknown {
122 pctx.CropGravity = po.Gravity()
123 }
124
125 return pctx
126}

Callers 1

RunMethod · 0.95

Calls 2

CropGravityMethod · 0.80
GravityMethod · 0.80

Tested by

no test coverage detected