[SOLVED] Hugo cannot find image for processing

I’m trying to make a simple image processing sample to work, but I failing.

I don’t know if it’s a bug or I’m doing something very wrong.

I create a repository, trying to isolate the problem.

I using Hugo 0.37. The OS is Window 10 (x64).

Here is the repo link: https://gitlab.com/julianoaklein/hugo-image-test

The console error I’m receiving:

Change detected, rebuilding site
2018-03-30 09:22:12.392 -0300
Source changed "D:\\Projetos\\hugo\\image-test\\content\\authors\\juliano-appel-klein\\index.html": WRITE
ERROR 2018/03/30 09:22:12 error processing shortcode "shortcodes/imgproc.html" for page "authors\\juliano-appel-klein\\index.html": template: shortcodes/imgproc.html:7:34: executing "shortcodes/imgproc.html" at <$original.Resize>: can't evaluate field Resize in type resource.Resource
Total in 18 ms

The thing is the resource is a image.
If I remove the shortcode from “index.html”, I fall into another issue. The server runs, but I won’t display the image properly.

Can someone help me? Thanks in advance!

Can at least someone tell me if image processing of Hugo 0.37 is working fine on Window 10?

I’m trying to use this feature in a very promising website.
Would be a shame to look for a workaround.

This has nothing to do with Windows 10. And I have edited the title of this thread.

Your shortcode syntax is wrong in your sample content file. The error you got means that Hugo cannot find the image for processing.

In your repo under /content/authors/juliano-appel-klein/index.html you call your shortcode like so: {{< imgproc sunset Resize "300x" />}}

The image under the above folder path is called SampleJPGImage_50kbmb.jpg

To call this image in your shortcode you need to call it like this:
{{< imgproc "SampleJPGImage_50kbmb.jpg" Resize "300x" >}}

Also note that I have eliminated the slash at the end of your shortcode.
/>}} becomes >}}

And lo and behold the image will be rendered.

1 Like

I’m feeling embarassed. What a silly mistake!

Thank you so much for your kind reply.