PDF to SVG conversion keeps EXIF orientation tags in embedded JPEG but should not
Steps to reproduce with poppler 2021.05:
- Convert the attached file test-with-exif-orientation.pdf to SVG using pdftocairo:
pdftocairo -svg -l 1 -f 1 test-with-exif-orientation.pdf test-with-exif-orientation.pdf.svg
- Open the result in Chrome or Firefox
- Expected: the text on the picture is oriented horizontally
- Actual: the text is oriented vertically: test-with-exif-orientation.pdf.svg image
This PDF contains an embedded JPEG image which has EXIF orientation tag set to a non-default value (6). Adobe Reader, Chrome and other viewers ignore this tag when rendering the PDF; Poppler ignores it as well when converting the file to PNG. However, the tag is preserved in the JPEG image after conversion to SVG, so the browsers see the orientation in the JPEG and rotate the file.