CaiJimmy / hugo-theme-stack

Card-style Hugo theme designed for bloggers
https://stack.jimmycai.com
GNU General Public License v3.0
4.89k stars 1.6k forks source link

feat: add file types whitelist for image processing #885

Closed CaiJimmy closed 11 months ago

CaiJimmy commented 11 months ago

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:

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

https://gohugo.io/templates/output-formats/#media-types

netlify[bot] commented 11 months ago

Deploy Preview for stirring-liger-36accf ready!

Name Link
Latest commit
Latest deploy log https://app.netlify.com/sites/stirring-liger-36accf/deploys/65270a804c5a0c1caac60f91
Deploy Preview https://deploy-preview-885--stirring-liger-36accf.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.