christopher-ramirez/secretary — pull request #9 by timostrunk (2014-08-28 16:28:48+00:00)
Title: Initial image support in secretary

This is not really a pull request, but rather a "Hey, please check what I did, maybe you like it" - request.

I recently found secretary and wanted to use it to generate some reports in our software. First of all: Thanks for your effort! Using it is painless and it simply works!
However most of our results are images (plots, renderings, etc.) and so secretary required the ability to also insert images dynamically (i.e. without a placeholder image, because we do not a-priori know the number or size of images in a for-loop).

The pull request includes initial code to support image inclusion. Images can be included like this:

In Python:
foo.imageurl = "relative_path_to_image"
Inside a table cell:

{{ foo.imageurl|image }}

The image will then be scaled to the width of the current table cell.
The OpenDocument code should also scale it proportionally horizontally, but that doesn't work yet in LibreOffice, because of this bug (I guess): https://www.libreoffice.org/bugzilla/show_bug.cgi?id=45884

I updated the test-case. When working correctly, it should show a distored star. Currently it shows an undistorted star, because of the LibreOffice bug.