Image Plugin Eccentricity

A brief look at the image plugin, as at April 2022. Just observations, both of how the plug works, its limitations, and known work around. In Image Plugin Commentary we will discuss possible improvements.

# Journal Growth

Journal entries for images, both creation and editing, contain a copy of the image. This can cause the size of the journal, and the page file, to grow significantly.

# Text or Caption

Trying to understand what is happening with `item.text` and `item.caption`.

Remote image

On creation from either an image url, or file, drop we get both `text` and `caption`.

Tea-leaf jar with a design of wisteria by Ninsei, Edo period. MOA Museum, Atami, Shizuoka, Japan source

After editing the `text` field contains the edited content, while the `caption` still contains *Remote image*, the original text from the drop.

We get the same end result if we create a paragraph item with the caption, then use `ctrl-m` to bring back the factory and drop the image into it. This creation method saves on one copy of the image in the journal.

# Adjacent Images

Image placement can get interesting. They are placed using css `float: right`. This causes them to float to the right of the available space, be it the full page width, or the space to the left of a preceding image, or other item that uses this placement. If there are no items between the two images visually it will appear that the first image comes after the second, as it will be shown on the right of the page.

Two images, and paragraphs.

As can be seen above, if the second image extends below the image on the right side of the page, the space to the right of the image is not used by subsequent content.

Though if it does not extend below the first, subsequent content will use the space alongside the image on the right. This can cause a problem with the item disappearing below the image if it tries to make use of the full page width.

# Clearing Float

Some items do not work well when they follow an image. Either, like the map plugin with its use of layers will use the full page width and cover the image, or disappear under the image (I forget which plugin I saw doing that, so some detective work needed).

# Image Dialog

Double clicking on an image will open it in a *jquery dialog*. This is not a true window, so is constrained both in its placement and size by the current browser window. Any wiki links in the caption are not correctly handled, being displayed as raw html.

As they are not using the image plugin, any page wide images will not offer the same behaviour.

# Wide Images

The image plugin only supports a single *narrow* presentation of an image. To get around this some authors have resorted to using the `html` plugin.

Slow Music Project : source

The markup used, and the where the image is kept, are all left up to the author. It is probable that forking a page containing such images could break the image link. This can be avoided by using full URLs, and storing it on a site that uses https.