zola: resize_image causing random build errors
Bug Report
Environment: Mac os 12.6.2
Zola version: 0.16.0
Issue
Zola keeps getting itself in a state whereby it won’t run. I get resize_image fail errors saying it can’t find random images in my project. The only fix is to open the template that has the resize_image call, comment it out and then try again. Eventually the site will build again and I can go around and remove the comments and reintroduce the resize_image calls.
My site has a lot of images and a lot of resize_image calls. It takes around 20-30 seconds to build. (On a side note it would be great if some sort of resize_image caching could speed up the builds).
jimmyff@jimmys-mbp-5 jimmyff % zola serve --drafts
Building site...
Error: Failed to serve the site
Error: Failed to render content of /Users/jimmyff/dev/jimmyff/content/gallery/2019-06-13-porcelain-wet-palette/index.md
Error: Reason: Failed to render image shortcode
Error: Reason: Failed to render 'shortcodes/image.html'
Error: Reason: Function call 'get_image_metadata' failed
Error: Reason: `get_image_metadata`: Cannot find path: .//gallery/porcelain-wet-palette/porcelain_wet_palette.webp
jimmyff@jimmys-mbp-5 jimmyff % zola serve --drafts
Building site...
Error: Failed to serve the site
Error: Failed to render content of /Users/jimmyff/dev/jimmyff/content/gallery/2022-05-10-still-life-whisky/index.md
Error: Reason: Failed to render image shortcode
Error: Reason: Failed to render 'shortcodes/image.html'
Error: Reason: Function call 'get_image_metadata' failed
Error: Reason: `get_image_metadata`: Cannot find path: .//gallery/still-life-whisky/whisky.webp
jimmyff@jimmys-mbp-5 jimmyff % zola serve --drafts
Building site...
Error: Failed to serve the site
Error: Failed to render content of /Users/jimmyff/dev/jimmyff/content/gallery/2019-06-19-sketch-a-day-painter/index.md
Error: Reason: Failed to render image shortcode
Error: Reason: Failed to render 'shortcodes/image.html'
Error: Reason: Function call 'get_image_metadata' failed
Error: Reason: `get_image_metadata`: Cannot find path: .//gallery/sketch-a-day-painter/jimmy.webp
jimmyff@jimmys-mbp-5 jimmyff % zola serve --drafts
Building site...
Error: Failed to serve the site
Error: Failed to render content of /Users/jimmyff/dev/jimmyff/content/gallery/2019-06-16-sketch-a-day-magical/index.md
Error: Reason: Failed to render image shortcode
Error: Reason: Failed to render 'shortcodes/image.html'
Error: Reason: Function call 'get_image_metadata' failed
Error: Reason: `get_image_metadata`: Cannot find path: .//gallery/sketch-a-day-magical/magical.webp
jimmyff@jimmys-mbp-5 jimmyff %
Here you can see everytime i try to serve the site i get another random error. I’m not changing anything inbetween these attempts. The only fix seems to be to comment out the template and then add it back it once the build is working.
Step to reproduce
I’m currently migrating my site from hugo to zola, I will be able to share the repo in the next day or two once I commit & push.
Thanks
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 24 (2 by maintainers)
Fortunately with cargo that is actually pretty easy. It just takes a while. You just need to clone the repo on the branch you need and then run
cargo build --release
. It took under 5 minutes on my computer.Thanks for the site. I’ve already found one unrelated issue in Zola while using it so that’s good. Your site is much slower than what I’m expecting based on the its size, I’ll investigate more when I get some time.