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

Function ExtractGeometry

processing/prepare.go:11–22  ·  view source on GitHub ↗

ExtractGeometry extracts image width, height, orientation angle and flip flag from the image metadata.

(img *vips.Image, baseAngle int, autoRotate bool)

Source from the content-addressed store, hash-verified

9
10// ExtractGeometry extracts image width, height, orientation angle and flip flag from the image metadata.
11func ExtractGeometry(img *vips.Image, baseAngle int, autoRotate bool) (int, int, int, bool) {
12 width := img.Width()
13 height := img.Height()
14
15 angle, flip := angleFlip(img, autoRotate)
16
17 if (angle+baseAngle)%180 != 0 {
18 width, height = height, width
19 }
20
21 return width, height, angle, flip
22}
23
24// angleFlip returns the orientation angle and flip flag based on the image metadata
25// and po.AutoRotate flag.

Callers 2

CalcParamsMethod · 0.85
scaleOnLoadMethod · 0.85

Calls 3

angleFlipFunction · 0.85
WidthMethod · 0.45
HeightMethod · 0.45

Tested by

no test coverage detected