diff --git a/layouts/partials/images/image.html b/layouts/partials/images/image.html index 5fa8b33..55afdec 100644 --- a/layouts/partials/images/image.html +++ b/layouts/partials/images/image.html @@ -62,12 +62,16 @@ {{- end }} {{- with $res }} {{- $originalSrc = ($res | fingerprint "md5").RelPermalink }} - {{- $originalWidth = $res.Width }} - {{- $originalHeight = $res.Height }} {{/* Check if the image resource is valid. */}} {{- if ne $res.MediaType.MainType "image" }} {{- errorf "the image is invalid: %s" $filename }} {{- end }} + {{- if in (slice "image/avif") $res.MediaType.Type }} + {{- errorf "the image resource type %q is not supported: %s" $res.MediaType.Type $url.Path }} + {{- end }} + {{- warnf "%v" $res.MediaType }} + {{- $originalWidth = $res.Width }} + {{- $originalHeight = $res.Height }} {{/* Resize the image. */}} {{- if and $width $height }} {{- $res = .Resize (printf "%sx%s" (strings.TrimSuffix "px" $width) (strings.TrimSuffix "px" $height)) }}