Skip to content
Snippets Groups Projects
Unverified Commit a8158432 authored by Alexis BENOIT's avatar Alexis BENOIT Committed by GitHub
Browse files

Ratio des images depuis les données (#640)

parent 269f8e46
No related branches found
No related tags found
No related merge requests found
{{ $ratio := partial "GetImageRatio" . }}
{{ $direction := "square" }}
{{ if gt $ratio 1 }}
{{ if gt .ratio 1 }}
{{ $direction = "landscape" }}
{{ else if lt $ratio 1 }}
{{ else if lt .ratio 1 }}
{{ $direction = "portrait" }}
{{ end }}
......
{{ $image := partial "GetMedia" .id }}
{{ $ratio := 1 }}
{{ if $image }}
{{ if and $image.width $image.height }}
{{ $ratio = div (float $image.width) (float $image.height) }}
{{ end }}
{{ end }}
{{ return $ratio }}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment