Using Data URIs for image field values

The more I think about this, the more I agree. I have done too much unnecessary work with naming schemes. And for several wikis where I use member images, so far they look like this:

title: Scott Sauyet
tags: Member
avatar: ScottSauyet.jpg
...

With a template that looks like this:

<% if [<currentTiddler>has[avatar]] %><div class="avatar"><$image source={{!!avatar}} /></div><% endif %>
<$transclude $tiddler="$:/_/my/templates/MemberInfo" $mode="block"/>
{{||$:/core/ui/ViewTemplate/body/default}}
<% if [<currentTiddler>has[avatar]] %><div style="clear: both"></div><% endif %>

While the rule that converts "Scott Sauyet" to "ScottSauyet.jpg" is easy enough to implement, and while currently that’s done outside TW as I generate these members from an external source, I really have no need for for the separate image tiddler. Every place it’s used now is in the context of the member tiddler. So inlining seems to harm nothing, and reduces my tiddler count.

The best thing is that I have to change no wiki code whatsoever to switch to these inlined images. I hadn’t thought about it when I posted the above, but <$image source={{!!avatar}}> works whether avatar is a data uri or the name of another tiddler.

When I get time, I will see if I can create a field editor that allows an image file upload or drop and stores it as a data uri. That would make this quite convenient.