Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXIF orientation is ignored #10311

Open
xi opened this issue Oct 20, 2024 · 2 comments
Open

EXIF orientation is ignored #10311

xi opened this issue Oct 20, 2024 · 2 comments
Labels

Comments

@xi
Copy link

xi commented Oct 20, 2024

To reproduce this issue, I used the images from https://github.com/recurser/exif-orientation-examples/ (see exact markdown below).
In the generated pdf, the images do not have the correct orientation. I get the same result when converting to odt or docx.

Tested with both pandoc 3.1.11.1 (debian trixie) and pandoc 3.5 (docker)

![](https://raw.githubusercontent.com/recurser/exif-orientation-examples/refs/heads/master/Landscape_0.jpg)

![](https://raw.githubusercontent.com/recurser/exif-orientation-examples/refs/heads/master/Landscape_1.jpg)

![](https://raw.githubusercontent.com/recurser/exif-orientation-examples/refs/heads/master/Landscape_2.jpg)

![](https://raw.githubusercontent.com/recurser/exif-orientation-examples/refs/heads/master/Landscape_3.jpg)

![](https://raw.githubusercontent.com/recurser/exif-orientation-examples/refs/heads/master/Landscape_4.jpg)

![](https://raw.githubusercontent.com/recurser/exif-orientation-examples/refs/heads/master/Landscape_5.jpg)

![](https://raw.githubusercontent.com/recurser/exif-orientation-examples/refs/heads/master/Landscape_6.jpg)

![](https://raw.githubusercontent.com/recurser/exif-orientation-examples/refs/heads/master/Landscape_7.jpg)

![](https://raw.githubusercontent.com/recurser/exif-orientation-examples/refs/heads/master/Landscape_8.jpg)

![](https://raw.githubusercontent.com/recurser/exif-orientation-examples/refs/heads/master/Portrait_0.jpg)

![](https://raw.githubusercontent.com/recurser/exif-orientation-examples/refs/heads/master/Portrait_1.jpg)

![](https://raw.githubusercontent.com/recurser/exif-orientation-examples/refs/heads/master/Portrait_2.jpg)

![](https://raw.githubusercontent.com/recurser/exif-orientation-examples/refs/heads/master/Portrait_3.jpg)

![](https://raw.githubusercontent.com/recurser/exif-orientation-examples/refs/heads/master/Portrait_4.jpg)

![](https://raw.githubusercontent.com/recurser/exif-orientation-examples/refs/heads/master/Portrait_5.jpg)

![](https://raw.githubusercontent.com/recurser/exif-orientation-examples/refs/heads/master/Portrait_6.jpg)

![](https://raw.githubusercontent.com/recurser/exif-orientation-examples/refs/heads/master/Portrait_7.jpg)

![](https://raw.githubusercontent.com/recurser/exif-orientation-examples/refs/heads/master/Portrait_8.jpg)
@xi xi added the bug label Oct 20, 2024
@silby
Copy link
Contributor

silby commented Nov 5, 2024

I did a little bit of research.

JuicyPixels can tell you the EXIF orientation for an image, if present in the metadata.

EXIF orientation takes on the following values (ref):

1 = Horizontal (normal)
2 = Mirror horizontal
3 = Rotate 180
4 = Mirror vertical
5 = Mirror horizontal and rotate 270 CW
6 = Rotate 90 CW
7 = Mirror horizontal and rotate 90 CW
8 = Rotate 270 CW

T.P.ImageSize could use this information to swap width and height for quarter-turned images (orientations 5-8).

Writers that embed image data into documents where EXIF orientation is not automatically respected can apply transforms when outputting the image, e.g.:

  • LaTeX graphics/graphicx: \reflectbox and \rotatebox or \includegraphics[angle=90]
  • MS Office: add rotation and mirroring to <a:xfrm> element
  • OpenDocument: draw:transform attribute on <draw:frame> element
    etc.

@silby
Copy link
Contributor

silby commented Nov 15, 2024

Messing around in libreoffice, Exif entirely to the side, there doesn't actually seem to be a way to rotate an anchored-as-character (i.e., inline) image a quarter turn and have it appear both uncropped and at the correct aspect ratio. Apache OpenOffice (does anyone use that?) doesn't even support rotated images. Neat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants