DocumentServer
DocumentServer copied to clipboard
Bug: Image Exif data is not processed, resulting in rotated images on export
Do you want to request a feature or report a bug? Bug
What is the current behavior? Images with rotation information in the exif data are not rotated upon export. All other document processors I tested (LibreOffice, Microsoft Word) do not interpret exif data, so the image appears rotated in the document. This is also the case when exporting to PDF.
This is important because phone camera images typically rotate images using the exif metadata.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. For this demo, I have created 2 test images:
test.jpg: This is a file with no exif data.
Internal representation (screenshot of GIMP):
test-rotate-with-exif.jpg: This file notates rotation using its exif data.
Internal representation (screenshot of GIMP):
Also has the following exif metadata:
Orientation : Rotate 90 CW
Reproduction Steps
- Insert both images into a docx document
- Export the docx to any format (docx, pdf, odt)
- Open the exported file using the viewer/editor of your choice
- Observe screenshots below
docx opened in LibreOffice (issue also occurs in Microsoft Word):
PDF opened with Firefox built-in pdf renderer (issue also occurs in Okular):
What is the expected behavior? Images should be cleared of exif data and rotated by the DocumentServer. This serves 2 purposes:
- Fixes this issue
- Privacy. Documents shared with others will not include all exif data of the image, as this contains geolocation, creation date, and extensive information on the phone/camera that took the image.
Did this work in previous versions of DocumentServer? Not sure.
DocumentServer version: 7.1.1
Operating System: Linux
Browser version: Firefox 101.0
Related issue
This has the same root cause as #1192. In the example document shared there, both images contain Orientation exif data. Libreoffice and other document processors do not read this data while onlyoffice does, so it results in an incorrect orientation.