Commit Graph

42 Commits

Author SHA1 Message Date
Roberto Rosario
9564db398f Backport configuration file improvements
Remove support for quoted entried. Support unquoted entries. Support
custom location for the config files.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2019-07-09 15:40:20 -04:00
Roberto Rosario
4e5c513529 Remove converter.to_pdf iterator
Remove the custom iterator to return the result of a conversion to PDF.
Instead returns a file object which can then be copied around
using shutil.copyfileobj.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2019-05-14 02:01:14 -04:00
Roberto Rosario
73546bd99f PEP8 cleanups
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2019-05-03 01:57:41 -04:00
Roberto Rosario
ea3b513ae3 Add new app to handle all dependencies
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2019-05-03 01:12:20 -04:00
Roberto Rosario
8b447a7050 Use copyfileobj in Python converter backend
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2019-04-29 04:54:42 -04:00
Roberto Rosario
3fa08debe9 Initialize Pillow inside ConverterBase __init__
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2019-04-27 02:29:44 -04:00
Roberto Rosario
58813310b7 Move Pillow initialization
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2019-04-15 16:00:55 -04:00
Roberto Rosario
0d4ab4f2cf Move setting to the storage app
The setting COMMON_TEMPORARY_DIRECTORY is now
STORAGE_TEMPORARY_DIRECTORY.

Move file related utilities to the storage app.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2019-04-12 22:26:43 -04:00
Roberto Rosario
40c9436071 Update PyYAML to version 5.1
Update use of safe_load and safe_dump to load and dump using
the CSafeLoader with SafeLoader as a fallback.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2019-04-12 03:09:07 -04:00
Roberto Rosario
36a51eeb73 Switch to full app paths
Instead of inserting the path of the apps into the Python app,
the apps are now referenced by their full import path.

This solves name clashes with external or native Python libraries.
Example: Mayan statistics app vs. Python new statistics library.

Every app reference is now prepended with 'mayan.apps'.

Existing config.yml files need to be updated manually.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2019-04-05 02:02:57 -04:00
Roberto Rosario
9dba40a1d8 Use BytesIO instead of StringIO. Use text_type instead of unicode.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-08-29 02:12:18 -04:00
Roberto Rosario
b6ffeaeb32 Allow changing the output format, DPI of the pdftoppm command, and
the output format of the converter via the CONVERTER_GRAPHICS_BACKEND_CONFIG
setting sub options: pdftoppm_dpi: 300, pdftoppm_format: jpeg, pillow_format: jpeg
GitHub issues #256 #257 GitLab issue #416.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-08-03 01:10:39 -04:00
Roberto Rosario
28b4c9a546 Add workaround for PDF with IndirectObject as the
rotation value. GitHub #261.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-07-30 04:17:23 -04:00
Roberto Rosario
6dc45a1c7f Allow encrypted PDF total page number instrospection to work
when PDF has non ASCII user properties. GitLab issue #411.
Thanks to @corneliusludmann for the report and investigation.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-07-22 02:45:18 -04:00
Roberto Rosario
7343223f59 PDF compatibility improvements. Support simple encrypted PDF.
Improve PDF page count detection. Improve PDF orientation
detection. Merge CONVERTER_LIBREOFFICE_PATH and
CONVERTER_PDFTOPPM_PATH config settings into
CONVERTER_GRAPHICS_BACKEND_CONFIG.
GitLab issue #384 #376 #377.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-07-04 04:02:29 -04:00
Roberto Rosario
4150fea2ad Add PDF orientation detection. Closes GitLab issue #387.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-06-16 22:30:07 -04:00
Roberto Rosario
945158bd60 Normalize handling of temporary file and directory creation. 2016-06-23 20:54:10 -04:00
Roberto Rosario
26fce66451 Change pngtoppm to convert PDFs to JPEG instead of PNGs. 2016-03-21 03:49:11 -04:00
Roberto Rosario
923ecc85d8 PEP8 Cleanups. 2015-10-28 02:22:10 -04:00
Roberto Rosario
a76a8b7e0a Reset pointer before attemping a conversion. 2015-10-07 03:17:02 -04:00
Roberto Rosario
dbd676646b Don't convert images blindly to RGB. Only convert to RGB or RGBA when saving to JPEG and mode is 'P'. documents.tests.test_models.MultiPageTiffTestCase passes again. 2015-09-16 15:56:10 -04:00
Roberto Rosario
d6a3111d69 Make sure all images are converted to RGB before processing. 2015-09-15 02:01:56 -04:00
Roberto Rosario
2f030ab162 Properly raise PageCountError when unable to determine a document's page count. 2015-08-06 02:57:02 -04:00
Roberto Rosario
1361ea9b42 Remove dependency on slate to calculate page number in PDF files. 2015-07-31 02:09:10 -04:00
Roberto Rosario
3b728328ad PEP8 cleanups, E501. 2015-07-23 04:05:29 -04:00
Roberto Rosario
3d7e7ae4a2 Add support for getting an office document page count. 2015-07-03 03:19:42 -04:00
Roberto Rosario
956ca08cbd Fix converter backend 2015-06-27 23:32:52 -04:00
Roberto Rosario
b18888b3f7 Convert and cache office documents at the document version level for faster page image retrieval 2015-06-24 01:04:35 -04:00
Roberto Rosario
78198f3398 Smart settings refactor 2015-06-22 21:04:06 -04:00
Roberto Rosario
32fe03aaa7 PEP8 clean up and trivial typo fixes 2015-06-08 15:54:54 -04:00
Roberto Rosario
b256758db2 Implement class based converter transformations 2015-06-07 05:29:31 -04:00
Roberto Rosario
f4752a3f3f Further converter refactor and initial move from document-centric to page-centric image generation. Issue #93. 2015-06-06 06:26:44 -04:00
Roberto Rosario
de6182aea0 Initial commit of the converter refactor 2015-06-05 03:35:07 -04:00
Roberto Rosario
f4d3767b15 PEP8 cleanup, remove unused imports, fix permission check when removing metadata from a document 2015-01-26 19:17:35 -04:00
Roberto Rosario
b55acb6e12 Normalize import style 2015-01-24 17:05:32 -04:00
Roberto Rosario
d59ea3ede2 Add from __future__ import unicode_literals, issue #37 2015-01-19 04:06:40 -04:00
Roberto Rosario
aca9d8c9eb Remove unused imports, do PEP8 and DeprecationWarning cleanups 2015-01-05 14:40:59 -04:00
Roberto Rosario
76fc6c091f Remove all direct use of ghost script, add PDFTOPPM_PATH to allow configurable pdftoppm path, raise ConvertError on coverterror and not UnknownFile exception blindly 2014-11-18 04:46:24 -04:00
Roberto Rosario
ed11e242ca Issue #23, Experiment with pdftoppm 2014-11-18 00:35:56 -04:00
Roberto Rosario
97dcf507ab PEP8 cleanups 2014-10-08 18:14:05 -04:00
Roberto Rosario
7f62831c37 Issue #56, Remove the "Supported File Format" list view, messages and related code 2014-10-01 22:19:08 -04:00
Roberto Rosario
a9390d55ba Unify the way backends are defined and loaded, unify the fs_cleanup function 2014-07-01 00:22:31 -04:00