jpanther / congo

A powerful, lightweight theme for Hugo built with Tailwind CSS.
https://jpanther.github.io/congo/
MIT License
1.17k stars 309 forks source link

Images flipped 90 degrees #600

Open tomleary opened 1 year ago

tomleary commented 1 year ago

Issue description

Images taken horizontally show up fine, but anything taken vertically is rendered horizontally.

Screenshot 2023-07-12 at 3 57 40 PM

The code is simply:

![Alt text](ghat3.jpg "Image caption")
![Alt text](ghat4.jpg "Image caption")

I feel like this can't be standard behavior, so maybe I accidentally changed a configuration file without realizing it. Otherwise, it might have to do with the way the theme tries to make all the images the same width.

Theme version

v2.6.1

Hugo version

hugo v0.112.1+extended

Which browser rendering engines are you seeing the problem on?

Chromium

DejavuMoe commented 1 year ago

Are you taking pictures with iPhone, which seems to have incorrectly rotated EXIF information?

tomleary commented 1 year ago

Those photos were taken with an Android, though I've had the same problem with iPhone photos, too. All the photos show up fine in every other image-viewing application. They also show up fine if I embed them with HTML instead of Markdown or the figure shortcode.

Screenshot 2023-07-12 at 8 56 21 PM
<img src="ghat3.jpg" />
<img src="ghat4.jpg" />
BenAlexanderAU commented 1 year ago

To assist (as a workaround and troubleshooting)...

I also have this issue with most (but not all) portrait images taken on my Android phone. As a workaround, I am using an image editor on my PC to rotate the image 90 degrees, save, and then rotate back and save again... Now the image will appear in the correct orientation on the website.

I believe this indicates it is an EXIF issue. I am uncertain if the Android EXIF data needs to be fixed, or if there is another orientation indicator Huge can use.

jpanther commented 1 year ago

I have seen this commented from time to time in the discussions and there's a lot on the Hugo Discourse about it too. There seems to be issues with how EXIF data is interpreted and that Hugo doesn't rotate the images to match the EXIF orientation. I might have to see if I can add this logic to the theme itself. See https://discourse.gohugo.io/t/image-exif-orientation/22902 for details.

github-actions[bot] commented 5 months ago

This issue has been automatically marked as stale because it has not had any recent activity. If you are still experiencing this issue, please review the issue history and add a reply with any requested and/or additional information in order to keep the issue open. This issue will automatically close in 30 days if no further activity occurs.

jmooring commented 3 months ago

https://gohugo.io/functions/images/autoorient/

I would find a way to opt-in to this behavior. You don't need to run every image on every site through this filter. Maybe use a site param to opt-in for the whole site, or a page param to opt-in for a particular page.