boratanrikulu / eternity

A minimalist Hugo theme designed for portfolio sites.
https://eternity.bora.sh
MIT License
237 stars 78 forks source link

Rotate issue #49

Closed boratanrikulu closed 9 months ago

boratanrikulu commented 1 year ago
          Hi there, I think I'm having the same issue, not sure how to fix it though :/

https://welbornmetal.com/furniture/shoe_rack_2/

Originally posted by @CAinDE in https://github.com/boratanrikulu/eternity/issues/7#issuecomment-1477245527

Klar commented 1 year ago

I have the same issue, in the "preview" the image is correct (rotated). When I click the Image i.e the post it is not rotated correctly.

From my understanding it should be simple to fix?

Did someone already fix it?

Klar commented 1 year ago

It works if I set in config.yml disableAlwaysResize: true

Fix must be something todo with:

https://github.com/boratanrikulu/eternity/blob/19a478ff293308b5fca7e222ca0c744675e81582/layouts/partials/slides/slider.html#L29

https://github.com/boratanrikulu/eternity/blob/19a478ff293308b5fca7e222ca0c744675e81582/layouts/partials/slides/slide.html#L26

Not sure how to fix it with disableAlwaysResize: false

boratanrikulu commented 1 year ago

Hi,

It should be fixed like this;

  1. We have some rules here; https://github.com/boratanrikulu/eternity/blob/main/layouts/partials/slides/slider.html#L29, it should be updated like this;
    {{ with $img.Exif }}
    {{ if eq .Tags.Orientation 6 }}
        {{ $resizer = "1000x r270" }}
    {{ end }}
    {{ if eq .Tags.Orientation 3 }}
        {{ $resizer = "1000x r180" }}
    {{ end }}
    {{ end }}
  2. Same rotate fix lines should be added here (to keep it DRY, a helper method would be nice): https://github.com/boratanrikulu/eternity/blob/main/layouts/partials/slides/slide.html#L27
    {{ $resizer := "3000x r0" }}
    {{ with $img.Exif }}
    {{ if eq .Tags.Orientation 6 }}
        {{ $resizer = "3000x r270" }}
    {{ end }}
    {{ if eq .Tags.Orientation 3 }}
        {{ $resizer = "3000x r180" }}
    {{ end }}
    {{ end }}
    {{ $img = $img.Resize $resizer }}

Sadly, I don't have time to fix it myself, PRs are welcome.

Aflynn50 commented 1 year ago

Awesome! Just been having this problem myself, managed to fix it thanks to this.

Aflynn50 commented 1 year ago

I've put up a PR to implement the changes.

boratanrikulu commented 9 months ago

[!WARNING]
This project is currently not being actively maintained.
Please do not create new issues on GitHub.