collective / collective/collective.documentviewer

Wrongly oriented image files generated from landscape PDFs

Open
#86 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
20
Forks
25
PR merge metrics
No merged PRs in 30d

Description

I have a PDF file exported from Powerpoint that c.documentviewer wrongly converts to images in portrait mode. The pages of the source PDF are all in landscape.

My fix for this issue was to change the order of the GM options in converter.py:

from:
```
cmd = [
self.binary, "convert",
'-resize', str(size[1]) + 'x',
'-density', '150',
'-format', format,
filename, output_file]
```
to:
```
cmd = [
self.binary, "convert",
filename,
'-resize', str(size[1]) + 'x',
'-density', '150',
'-format', format,
output_file]
```

The gm [documentation](http://www.graphicsmagick.org/convert.html) states:

`gm convert [ options ... ] input_file [ options ... ] output_file
`

so encoder options are better added after the input_file

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.