Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails when featured image is not a raster image #705

Closed
3 tasks done
ElanHasson opened this issue Sep 13, 2022 · 5 comments
Closed
3 tasks done

Build fails when featured image is not a raster image #705

ElanHasson opened this issue Sep 13, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@ElanHasson
Copy link
Contributor

Prerequisites

Describe the issue

When using an SVG as a featured image, build fails.

webpack 5.74.0 compiled successfully in 143 ms
Start building sites … 
hugo v0.102.3-b76146b129d7caa52417f8e914fc5b9271bf56fc+extended linux/amd64 BuildDate=2022-09-01T10:16:19Z VendorInfo=gohugoio
WARNING: calling IsSet with unsupported type "bool" (bool) will always return false.
Error: Error building site: failed to render pages: render of "home" failed: "/workspaces/throw.nullreference.io/themes/hugo-theme-bootstrap/layouts/index.json:18:36": execute of template failed: template: index.json:18:36: executing "index.json" at <$featured.Resize>: error calling Resize: this method is only available for raster images. To determine if an image is SVG, you can do {{ if eq .MediaType.SubType "svg" }}{{ end }}
Built in 1627 ms

root cause is here:

https://github.com/razonyang/hugo-theme-bootstrap/blob/v0/layouts/index.json#L18-L22

There should be a guard here to prevent resizing of SVG featured images.

Steps to reproduce

Use a SVG for a featured image.

Expected behavior

Should not fail-- should not attempt to resize svgs.

What operating system(s) are you seeing the problem on?

Windows, Linux

What browser(s) are you seeing the problem on?

No response

What version of theme are you using?

v0.80.

What version of Hugo are you using?

0.102.3

What version of Node.js are you using?

v14.20.0

What version of Git are you using?

2.37.3

Additional context

No response

@ElanHasson ElanHasson added the bug Something isn't working label Sep 13, 2022
@ElanHasson
Copy link
Contributor Author

ElanHasson commented Sep 13, 2022

This was introduced in #518

@razonyang
Copy link
Owner

Closed by #706.

@ElanHasson
Copy link
Contributor Author

@razonyang when will release get cut so I don't have to use a fork?

@razonyang
Copy link
Owner

@ElanHasson Done, drafted a new release v0.80.4.

@ElanHasson
Copy link
Contributor Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants