layouts/partials/featured.html: Orientation 6
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This handles images that have EXIF orientation "RightTop" aka 6, which we need to rotate 270 degrees clockwise to make normal. See: https://www.impulseadventure.com/photo/exif-orientation.html
This commit is contained in:
parent
0f275cbee6
commit
b524043127
@ -38,6 +38,10 @@
|
|||||||
{{/* Rotate image before cropping because Hugo's "Smart" cropping crops differently if we do it at the same time as .Fill with a rotation) and use 2x dimensions to keep the thumbnail crisp */}}
|
{{/* Rotate image before cropping because Hugo's "Smart" cropping crops differently if we do it at the same time as .Fill with a rotation) and use 2x dimensions to keep the thumbnail crisp */}}
|
||||||
{{ $RotatedImage := $image.Resize "480x600 r90" }}
|
{{ $RotatedImage := $image.Resize "480x600 r90" }}
|
||||||
<img src={{ ($RotatedImage.Fill "480x600").RelPermalink }} width="240" height="300" />
|
<img src={{ ($RotatedImage.Fill "480x600").RelPermalink }} width="240" height="300" />
|
||||||
|
{{ else if eq $orientation 6 }}
|
||||||
|
{{ $RotatedImage := $image.Resize "480x600 r270" }}
|
||||||
|
<img src={{ ($RotatedImage.Fill "480x600").RelPermalink }} width="240" height="300" />
|
||||||
|
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<img src={{ ($image.Fill "480x600").RelPermalink }} width="240" height="300" />
|
<img src={{ ($image.Fill "480x600").RelPermalink }} width="240" height="300" />
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
Loading…
Reference in New Issue
Block a user