Image processing rotates images

I’m facing an issue with image processing that has been causing unexpected image rotation.

I use the following code to process and display images:

{{ range .Params.images }}
  {{ with resources.Get .image}}
    {{ with .Resize "620x webp" }}
      <img src="{{ .RelPermalink }}" alt="">
    {{ end }}
  {{ end }} 
{{ end }}

The processed images are rotated horizontally, even though the original images have the correct orientation in their EXIF data.

The short story is that Hugo’s image handling does not respect the EXIF rotation info. I have had it on my todo list to improve on for some time, and we’ll get there.

There are workarounds described here on the forum (which involves reading the exif info and rotate the image), but for my Hugo use cases, I seem to always have some kind of processing step (publish from LightRoom) and this has never been an issue for me. But I do understand the problem, and I will fix it (probably when I get around to upgrading the EXIF library we use).

1 Like

Thanks, I’ll look into some of the workarounds. This is for a client’s website so manually processing the images is not a real option for me.

1 Like

+1 :slight_smile: