{{- $root := . -}}

{{- if .Params.cover -}}
    {{- with .Resources.GetMatch (printf "%s*" .Params.cover) -}}
        {{- $res := . -}}
        {{- $root.Scratch.Set "thsrcset" "" -}}
        {{- range (slice 512 1024 1280 1600) -}}
            {{- if lt . $res.Width -}}
                {{- $root.Scratch.Add "thsrcset" ($res.Fill (printf "%dx%d q50" . .)).RelPermalink -}}
                {{- $root.Scratch.Add "thsrcset" (printf " %dw, " .) -}}
            {{- end -}}
        {{- end -}}

        <div class="thumbnail">
            <div class="squarer">
                <img
                    src="{{ ($res.Fill "256x256 q50").RelPermalink }}"
                    alt=""
                    width="256" height="256"
                    {{ printf "srcset=\"%s\"" (substr ($root.Scratch.Get "thsrcset") 0 -2) | safeHTMLAttr }}
                    />
            </div>
        </div>
    {{ end -}}
{{- end }}

{{- $root := . -}}

{{- if .Params.cover -}}
    {{- with .Resources.GetMatch (printf "%s*" .Params.cover) -}}
        {{- $res := . -}}
        {{- $root.Scratch.Set "thsrcset" "" -}}
        {{- range (slice 512 1024 1280 1600) -}}
            {{- if lt . $res.Width -}}
                {{- $root.Scratch.Add "thsrcset" ($res.Fill (printf "%dx%d q50 Center" . .)).RelPermalink -}}
                {{- $root.Scratch.Add "thsrcset" (printf " %dw, " .) -}}
            {{- end -}}
        {{- end -}}

        <div class="thumbnail">
            <div class="squarer">
                <img
                    src="{{ ($res.Fill "256x256 q50 Center").RelPermalink }}"
                    alt=""
                    width="256" height="256"
                    {{ printf "srcset=\"%s\"" (substr ($root.Scratch.Get "thsrcset") 0 -2) | safeHTMLAttr }}
                    />
            </div>
        </div>
    {{ end -}}
{{- end }}

Fix thumbnail generation with center anchoring
Fix thumbnail generation with center anchoring
