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

Alternate image formats not being displayed #326

Open
LITUATUI opened this issue Jun 15, 2022 · 7 comments
Open

Alternate image formats not being displayed #326

LITUATUI opened this issue Jun 15, 2022 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@LITUATUI
Copy link

The theme no longer shows AVIF images if available with the same name and goes straight to the JPG/PNG fallback.

@rootwork
Copy link
Contributor

@LITUATUI Do you know if it's happening for WebP images too, or just AVIF?

Also images can appear in a variety of ways and contexts, so to narrow this down can you specify:

  • Is this an image specified with frontmatter (featured image, thumbnail) or in the body of a post?
  • Are you using Hugo page bundles?
  • Is this a local image (on your system) or a remote image (a URL)?

Also if you could look at the image as it's rendered and tell me if it includes the CSS class image_processed or image_unprocessed that would be helpful too.

@LITUATUI
Copy link
Author

LITUATUI commented Jun 15, 2022

Hello.

It happens also with WebP images.

I have all images of my website in one folder and batch converted them to AVIF using ImageMagick. This includes featured images, thumbnails and images inside the body of the posts.

I'm not using page bundles, as all my posts are in one folder.

This happens with local images.

CSS classes:

<picture>
        
    <img loading="lazy" decoding="async" alt="SVOLT Energy new short blade batteries" class="image_figure image_internal image_unprocessed" src="/images/posts/SVOLT-Energy-new-short-blade-batteries.jpg" data-pos="1"><figcaption class="img_alt">SVOLT Energy new short blade batteries</figcaption>

    </picture>

Showing the AVIF version of images works great if I use an older version of this theme, for example (20220407195657-f40414b5292c). So at least I know that the bug was introduced after Apr 7, 2022.

The Clarity theme is installed as a Hugo module, so I can easily go back to an older version/commit.

@rootwork
Copy link
Contributor

Thanks! This is very helpful. I'll see what I can figure out.

@rootwork rootwork changed the title No longer shows AVIF images Alternate image formats not being displayed Jun 15, 2022
@rootwork rootwork added the bug Something isn't working label Jun 15, 2022
@rootwork rootwork self-assigned this Jun 15, 2022
@rootwork rootwork mentioned this issue Jul 1, 2022
3 tasks
@rootwork
Copy link
Contributor

rootwork commented Jul 1, 2022

Can you say a little more about where your content and images are? I assume your posts are in content/posts/? Are the images in question in assets/images/posts/ or static/images/posts/?

@LITUATUI
Copy link
Author

LITUATUI commented Jul 2, 2022

Posts: content/posts/
Images: static/images/posts/

If I use an old version of this theme everything works as supposed to.

@rootwork
Copy link
Contributor

rootwork commented Jul 2, 2022

Images in static can't have any of Hugo's image processing run on them, because they can't be loaded as a resource.

If it ever did work with images from static, that was an accident -- but now I'm curious how that happened! Do you know what git commit you're on in the version of the theme that this works for you?

@LITUATUI
Copy link
Author

LITUATUI commented Jul 2, 2022

This commit made it stop working.

The last working commit for me is: f40414b

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

Successfully merging a pull request may close this issue.

2 participants