Gallery module error message

Hi all, I am building my website with Hugo/wowchemy. In particular, I am trying to add an album to one of my pages. I followed the instructions here and that’s what my page says:

title: Photo album
summary: '' 
date: ''

reading_time: false  # Show estimated reading time?
share: false  # Show social sharing links?
profile: false  # Show author profile?
comments: false  # Show comments?

# Optional header image (relative to `assets/media/` folder).
  caption: ""
  image: ""

{{< gallery album="<ALBUM-FOLDER>" >}}

However, I am getting the following message:

Error: error building site: "/Users/rp3650/Desktop/starter-hugo-academic-main/content/panini/": failed to render shortcode "gallery": failed to process shortcode: "/Users/rp3650/Library/Caches/hugo_cache/modules/filecache/modules/pkg/mod/": execute of template failed: template: shortcodes/gallery.html:34:17: executing "shortcodes/gallery.html" at <.Fit>: error calling Fit: this method is only available for image resources

I tried to use the demo album of the template I cloned, and it works, so it’s a problem related to my images, rather than the actual. I have tried to change the format (jpeg to jpg/png) and reduce the size (< 200 KB), but I still get the same error. Does anyone know what could be the source of the error?


You are more likely to receive an accurate and timely response from the Wowchemy team:

They also have an active Discord channel:

cc: @alcarazr

1 Like


Thank you for replying. I had already posted a question both in the GitHub discussion page and the discord channel. No reply at the moment, apart from someone actually suggesting to post on this forum.

Copied from Discord:

Try adding the images one by one until you find the offending one

1 Like

Hi @alcarazr,

Thanks for the message here too! I just replied to you on Discord!

1 Like

Ok, so people from Wowchemy Discord are suggesting to seek help here.

Try adding the images one by one until you find the offending one

I tried to do what @alcarazr was suggesting, but it looks like any picture would generate the error. Even more weirdly, I tried to put some of my pics in the built-in demo folder, and the same error popped up even when changing the folder. Now even after removing my pictures and having the default folder contain the default pictures only, I get the same error. Even removing all pictures from the linked folder, it would generate the same error.

Someone else from the Discord channel suggested that there are non-image hidden file(s) in the folder such as OS generated thumbnail files. But I couldn’t find anything like that in the folders, even after making hidden files visible.

Can anyone help?

I am adding this message here just to ask for help on this.


Hello there,

Would anyone be able to help? I have tried to posted it as a potential bug on the Hugo github page (because it really looks like it given my previous attempts to find the source of the problem), but it was closed and I was suggested to post on the forum… so here I am again here!

Your chances to get help here are a lot better if you post a link to a minimal repository showing the problem. Given that many people work regularly with images in Hugo, its rather improbable that you found a bug in Hugo nobody else has noticed before.

Hello! I have just spent over an hour debugging a similar error. I believe in my case, it was .DS_store file that was randomly appearing in assets/media/albums/demo for me.

1 Like

I had the same problem. That was the crucial tip to resolve the issue, thanks!
Maybe the gallery module should be changed to ignore these hidden file.