Files
hugo/docs/content/en/functions/reflect/IsImageResourceProcessable.md
T
2026-03-23 18:25:55 +01:00

1.0 KiB

title, description, categories, keywords, params
title description categories keywords params
reflect.IsImageResourceProcessable Reports whether the given value is a Resource object representing an image from which Hugo can extract dimensions and perform processing such as converting, resizing, cropping, or filtering.
functions_and_methods
aliases returnType signatures
bool
reflect.IsImageResourceProcessable INPUT

{{< new-in 0.157.0 />}}

{{% glossary-term "processable image" %}}

Usage

This example iterates through all project resources and uses reflect.IsImageResourceProcessable to ensure the image pipeline can perform transformations like resizing before processing begins.

{{ range resources.Match "**" }}
  {{ if reflect.IsImageResourceProcessable . }}
    {{ with .Process "resize 300x webp" }}
      <img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}" alt="Processed Image">
    {{ end }}
  {{ end }}
{{ end }}

{{% include "/_common/functions/reflect/image-reflection-functions.md" %}}