add pdf media type
authorAlon Levy <alon@pobox.com>
Wed, 27 Mar 2013 10:21:10 +0000 (12:21 +0200)
committerAlon Levy <alon@pobox.com>
Mon, 15 Apr 2013 06:51:21 +0000 (09:51 +0300)
commita80ebf3b64dce807d84ab3993984c211f55b47db
tree2e8eaebf18414ee511c0dc476a2be8d78253e46f
parent3cadb4a6cd1d5cfdef8712d00e4594345a15b4a7
add pdf media type

The new media type supports pdf and a subset of media recognized by libreoffice via
unoconv.

Every document added goes through:
* conversion to pdf with unoconv if not already a pdf
* creation of thumbnail and medium sized image, and pdfinfo generates
 some information (even for unoconv produces docs - should fix this)

Poppler (pdftocairo, pdfinfo) is used.  http://poppler.freedesktop.org/

A working but uglified pdf.js integration exists, which is enabled by
setting pdf.pdf_js=true mediagoblin_local.ini (disabled in mediagoblin.ini)

Adds one test to the test_submission test suite, and another separate test_pdf suite.
The tests are only run if media_types.pdf.processing.check_prerequisites passes, so
the test suite will not require any extra package.

TODO: make test suite say 'skipped' in that case instead of just 'ok'

Signed-off-by: Alon Levy <alon@pobox.com>
17 files changed:
.gitmodules [new file with mode: 0644]
docs/source/siteadmin/media-types.rst
extlib/pdf.js [new submodule]
mediagoblin/config_spec.ini
mediagoblin/media_types/pdf/__init__.py [new file with mode: 0644]
mediagoblin/media_types/pdf/migrations.py [new file with mode: 0644]
mediagoblin/media_types/pdf/models.py [new file with mode: 0644]
mediagoblin/media_types/pdf/processing.py [new file with mode: 0644]
mediagoblin/static/css/pdf_viewer.css [new file with mode: 0644]
mediagoblin/static/extlib/pdf.js [new symlink]
mediagoblin/static/js/pdf_viewer.js [new file with mode: 0644]
mediagoblin/templates/mediagoblin/base.html
mediagoblin/templates/mediagoblin/media_displays/pdf.html [new file with mode: 0644]
mediagoblin/tests/test_mgoblin_app.ini
mediagoblin/tests/test_pdf.py [new file with mode: 0644]
mediagoblin/tests/test_submission.py
mediagoblin/tests/test_submission/good.pdf [new file with mode: 0644]