Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Intermittent problem with AddResource in content adapter #14684

@jmooring

Description

@jmooring

See https://discourse.gohugo.io/t/56922/11.

This isn't anything new.

In short, creating a page resource (an image) by setting content.value to the string returned by a global resource's .Content value results in intermittent errors:

error calling Resize: failed to resize image "/home/kijana/Code/hugo-forum-topic-54852/content/products/_content.gotmpl": resize /products/window-frame/01.jpg: invalid JPEG format: short Huffman data

But the image is not corrupt in any way (views fine in any app, exiftool likes it, ImageMagick has no complaints, etc.).

In some cases I had to run this command 20 times to trigger the error:

rm -rf resources && hugo

The page resource is created without error if I set content.value to the global resource itself, which per the documentation is noted to be "more efficient".

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions