Theory and motivation
Images take up space. In general, the more space taken up inside a TW file, the worse the performance. It would be better to outsource images to the local file system, or a remote file system. The solution is to externalise files. Externalisation means exporting the image tiddlers to an external image file, emptying their binary content and populating the _canonical_uri field with the path to the external image. (_canonical_uri was chosen because of its memorability). There are 3 main ways of accomplishing this task:
-
By hand
You can do all these steps by hand, but it’s slow and error-prone. -
Using Node.js
There are instructions on Tiddlywiki.com for externalising files using the ‘‘node.js’’ version of TW. The problem is that you need a node.js installation, and it doesn’t work with stand-alone files. So you would have to convert your TW file to tiddlers, process the images, and then convert back -
File Upload plugin
The File Upload Plugin can automatically externalize your image files. The main complication here is that you need to have your TW file served by a WebDav server. If your normal method of accessing TW is not via WebDav, this might be complicated.
Here is a different approach – a set of tools that allow you to zip up your image files into one convenient download which you can then extract wherever you want. You can specify paths that get stored in the zip file and have the extraction recreate them when you unzip the archive. Every major platform and most smartphones now have a zip tool built in!
At the same time that the zip file is made, the image tiddlers have their new _canonical_uri field set. For this reason, it’s absolutely essential to verify that the zip file has been successfully created before saving your TW file.
Note that some output image names may have to be changed in order to accommodate allowed file paths.
I’ve only tested on Linux. Pathing might need to be tweaked for Windows.