reflect.IsImageResource
Reports whether the given value is a Resource object representing an image as defined by its media type.
Syntax
reflect.IsImageResource INPUT
Returns
bool
The following example demonstrates how to check if a resource is categorized as an image.
{{ with resources.Get "image.jpg" }}
{{ .MediaType.MainType }} → image
{{ reflect.IsImageResource . }} → true
{{ end }}
{{ with resources.Get "data.json" }}
{{ .MediaType.MainType }} → application
{{ reflect.IsImageResource . }} → false
{{ end }}Last updated:
February 24, 2026
:
content: Miscellaneous udpates for v0.157.0 (c3cb4363d)
Improve this page