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

How to respect (JPG) image rotation when converting to PDF #427

Closed
abias opened this issue Dec 5, 2017 · 1 comment
Closed

How to respect (JPG) image rotation when converting to PDF #427

abias opened this issue Dec 5, 2017 · 1 comment

Comments

@abias
Copy link

abias commented Dec 5, 2017

Hi Dag,

We are running unoconv with LibreOffice 5.4.3 as a document converter behind our Moodle learning management system (see https://docs.moodle.org/32/en/Universal_Office_Converter_(unoconv) for details). Moodle leverages Unoconv to convert all types of input documents to PDF which it then continues to process internally. This process works quite fine.

However, we have now seen problems with input files of type JPG which have a rotation set in their EXIF attributes, i.e. the image is stored in landscape format, but the viewing program rotates it on-the-fly before it is displayed. This storing strategy seems to be quite common with consumer cameras and smartphone cameras.

When asked to convert such a file to PDF, Unoconv does not respect the image rotation and just places the image onto the canvas as is it stored in the image file.

I am unsure who is to blame about this, Unoconv or Libreoffice?
I have also noticed issue #116, but I think that this is a different issue here as Unoconv / Libreoffice should just respect the existing image rotation and I don't want to force a particular canvas orientation.

Any help / hint how to solve this issue would be appreciated.

Thanks,
Alex

@regebro
Copy link
Member

regebro commented Feb 18, 2019

This is Libreoffice that makes that, Unoconv just passes the files to it for conversion.

Using Libreoffice to put a JPG into a PDF is massive overkill, a bit like shooting mosquitoes with a gun, you don't have much control over the outcome. It's better to use software dedicated to image or PDF conversions. I think Imagemagick can do this, but I'm not sure.

@regebro regebro closed this as completed Feb 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants