ExtractGeometry extracts image width, height, orientation angle and flip flag from the image metadata.
(img *vips.Image, baseAngle int, autoRotate bool)
| 9 | |
| 10 | // ExtractGeometry extracts image width, height, orientation angle and flip flag from the image metadata. |
| 11 | func 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. |
no test coverage detected