nicokaiser / hugo-theme-gallery

Gallery Theme for Hugo
https://nicokaiser.github.io/hugo-theme-gallery/
MIT License
305 stars 85 forks source link

Image remains horizontal despite orientation tags in TIFF #50

Closed CallMeL closed 5 months ago

CallMeL commented 5 months ago

Hi Nico, thank you for this brilliant work.

I was trying to add photos I took using a camera, but all the photos stay horizontal despite the orientation tags in TIFF is 6, do I need to write it specifically in Exif tag? Is there any chance to read the information in TIFF tag?

Screenshot 2024-03-14 at 20 36 09

Edited: in the general tag the orientation is also 6, I didn't find the orientation row in Exif tag

Thanks again!

nicokaiser commented 5 months ago

Thanks @CallMeL, glad you like the theme! I'm not sure if Hugo can process TIFF tags at all, could you send me an example photo where this occurs?

CallMeL commented 5 months ago

Hi @nicokaiser , this is one example image

nicokaiser commented 5 months ago

Thanks for the example! After short investigation I found out that the Orientation tag is not read at all in the example, because it was missing in the includeFields.

Could you change your hugo.toml and add the Orientation entry to includeFields?

  [imaging]
    quality = 75
    resampleFilter = "CatmullRom"
    [imaging.exif]
      disableDate = false
      disableLatLong = true
+     includeFields = "ImageDescription|Orientation"

This way the Orientation field is read from the images and used for rotation.

There is another way to achieve this without needing to include this field, but that would require at least Hugo v0.121.2. I may use this more elegant way in a future version (#51).

CallMeL commented 5 months ago

Thank you for the quick reply, it solved my problem perfectly!