Open xi opened 1 month ago
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.:
\reflectbox
and \rotatebox
or \includegraphics[angle=90]
<a:xfrm>
elementdraw:transform
attribute on <draw:frame>
element
etc.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.
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)