( ctx context.Context, img *vips.Image, po ProcessingOptions, imgdata imagedata.ImageData, )
| 97 | } |
| 98 | |
| 99 | func (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 | } |
no test coverage detected