brendonh/pyth — pull request #19 by watercrossing (2014-02-11 12:38:43+00:00)
Title: Image support for rtf documents

When currently opening a rtf document which contains an image, the image is parsed as a Paragraph, with the bytestring of the image as the Text. This makes filtering out images cumbersome - one has to filter out Texts based on their string lengths, and the representation is being messed up too.

This pull requests adds basic support for the images: A new Image class has been created, basically analogues to a text class, but it stores all relevant image metadata as defined in the rtf specifications. The parsers has been extended to fill the Image class appropriately.

I do realise that this project focuses primarily on "marked up text", so an alternative approach would be to drop images entirely, instead of putting them in a new image class.