Image Handling

Some basic image handling has been implemented

Inline

So far images work inline, sitting on the line's baseline. There is a workaround in place that if an image is more than twice as high as the surrounding text it will be treated as it's own block.

Block

There is a known issue with images as blocks, outside of p tags.

An Image outside of P is treated as a paragraph

The previous image has float style. As a Workaround a newline is added after it until we can support floating in the layouting. This is done if the inline image is more than 5 times as large as the current font pixel size. This should allow small inline images, like smileys to stay in line, while most float images would probably be larger than this.

Supported Attributes

Supported Image Formats

According to Apple the following image formats are supported for use with UIImage:

Data Source

Base64 encoded data SRC is supported, for example this red dot: Red dot

Another example:

Base64 encoded image

Remote Images

Images can also be loaded from remote URLs, even without specifying a size in the HTML. The code demonstrates how to update the DTTextAttachment's display size after download and triggering a re-layout.