hugo-theme-stack/layouts
Jimmy Cai 8dc2880a9c
feat: add file types whitelist for image processing (#885)
Add `allowedTypes` and `resizableTypes` to `imageProcessing` configuration

Prior to this commit, SVG images were not processed by `render-image.html` because SVG does not have a physical dimension like JPEG. This logic was done using a conditional.

I have now realised that Hugo can be very slow when resizing `gif` images. So I created this whitelist mechanism:

- `allowedTypes`: image types with width and height attributes
- `resizableTypes`: image types that can be resized

Here's a list of media types: bmp, gif, jpeg, png, svg+xml, tiff, webp

https://gohugo.io/templates/output-formats/#media-types
2023-10-11 22:51:42 +02:00
..
_default feat: add file types whitelist for image processing (#885) 2023-10-11 22:51:42 +02:00
page Merge branch 'master' into canary 2023-08-24 21:36:55 +02:00
partials refactor: drop support for external avatar 2023-09-11 18:40:53 +02:00
shortcodes feat(article): GitLab Snippets Shortcode (#627) 2022-06-11 11:04:20 +02:00
404.html refactor(i18n): translation key renaming (#68) 2020-12-19 01:41:26 +01:00
index.html Revert "Merge branch 'canary' into master" (#712) 2022-10-29 17:14:19 +02:00