No, there is not.
There’s a related proposal:
https://github.com/gohugoio/hugo/issues/9737
And a PR that was closed due to lack of activity (I just re-opened it):
https://github.com/gohugoio/hugo/pull/9797
With that PR, you could do something like this:
{{ with try (.Resize "200x") }}
{{ with .Err }}
{{ warnf "%s" . }}
{{ else }}
{{ with .Value }}
<img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}" alt="">
{{ end }}
{{ end }}
{{ end }}
Other than an extraneous fmt.Println
in the PR, it seems to work as expected.