diff --git a/layouts/partials/images/orientation_angle.html b/layouts/partials/images/orientation_angle.html new file mode 100644 index 0000000..480cfd7 --- /dev/null +++ b/layouts/partials/images/orientation_angle.html @@ -0,0 +1,13 @@ +{{ $orientation := .Exif.Tags.Orientation }} +{{/* EXIF orientation is specified as an integer corresponding to a 90ยบ rotation. */}} +{{ $angle := 0 }} +{{ if in (slice 1 2) $orientation }} + {{ $orientation = 0 }} +{{ else if in (slice 3 4) $orientation }} + {{ $orientation = 180 }} +{{ else if in (slice 5 6) $orientation }} + {{ $orientation = 90 }} +{{ else if in (slice 7 8) $orientation }} + {{ $orientation = 270 }} +{{ end }} +{{ return $orientation }}