Debian Codegraph @

docs/content/en/functions/images/Config.md

raw
1 ---
2 title: images.Config
3 description: Returns an image.Config structure from the image at the specified path, relative to the working directory.
4 categories: []
5 keywords: []
6 params:
7 functions_and_methods:
8 aliases: []
9 returnType: image.Config
10 signatures: [images.Config PATH]
11 aliases: [/functions/imageconfig]
12 ---
13
14 > [!NOTE]
15 > This is a legacy function, superseded by the [`Width`][] and [`Height`][] methods for [global resources](g), [page resources](g), and [remote resources](g). See the [image processing][] section for details.
16
17 ```go-html-template
18 {{ $ic := images.Config "/static/images/a.jpg" }}
19
20 {{ $ic.Width }} → 600 (int)
21 {{ $ic.Height }} → 400 (int)
22 ```
23
24 Supported image formats include AVIF, BMP, GIF, HEIC, HEIF, JPEG, PNG, TIFF, and WebP.
25
26 Hugo caches the result, so calling the function multiple times with the same path incurs no additional overhead.
27
28 [`Height`]: /methods/resource/height/
29 [`Width`]: /methods/resource/width/
30 [image processing]: /content-management/image-processing/