External images via _canonical_uri

If I create an image/jpeg tiddler and point to an external image using the _canonical_uri field, say https://upload.wikimedia.org/wikipedia/commons/9/91/Foro_Romano_Forum_Romanum_Roman_Forum_(8043630550).jpg

The image is displayed in the tiddler.

But if I try and display that image tiddler in another tiddler via the image link syntax it fails. What am I doing wrong?

[img[external_image_tiddler]]

Thanks

1 Like

Hi @myfta

It just works on tiddlywiki.com, so I guess the problem is local to your wiki.
Are you using lazy loading? Or maybe a CORS problem?

Fred

I did think it was my Brave browser, but I have checked on Tiddlyhost and the browser works OK there and I don’t have the issue.

My wiki is on Node.js

I have tried starting the wiki with the LazyLoad options https://tiddlywiki.com/static/LazyLoading.html but that make no difference.

If I create an image tiddler and the _canonical_uri points to the url of the image it loads OK. Where it fails is if I then try to link to that image tiddler with [img[image tiddler]] in a new tidddler.

This ought to be straigtforward. Maybe the issue is “Images do not load in Node.js” and is a bug rather than a configuration issue.

Maybe I’m misunderstanding here? I’ve no problem using _canonical_uri in my node setup

Here is my .tid with _canonical_uri set:

_canonical_uri: https://en.wikipedia.org/static/images/icons/wikipedia.png
created: 20250804015355568
modified: 20250804015512609
tags: scratch
title: scratch12: _canonical_uri
type: image/png

And then you can transclude that tid to get the image:

{{scratch12: _canonical_uri}} but you cant set the size

I’m able to call it as an image (and set size!) like so: [img width=54 height=42 [scratch12: _canonical_uri]]

My testing is with Node TW 5.3.6

edit/appendum: I also have (ages ago, and forgot it was there to re-test/demonstrate), a category tid with it’s icon field set to the name of a tid with an image via _canonical_uri. The icon correctly loads for that category tid.

1 Like

Thanks, this has proved most helpful and seems to have uncovered a glitch in TW5.

Using my image source, the transclusion method {{scratch12: _canonical_uri}} works as expected but calling the img [img width=54 height=42 [scratch12: _canonical_uri]] failed.

So I deleted both my image tidller and the tiddler that calls the image and re-created them. Strangely it now works.

I had checked the tiddler type, brackets and any spurious spaces.

This syntax, with the colon, is completely new to me, and I don’t see it in the documentation. Where is it in the docs?

Thanks!

Quoting @nemo,

title: scratch12: _canonical_uri

scratch12: _canonical_uri is literally the tiddler’s title, not a new syntax.

Fred

Oh, good. The FOMO was overwhelming.

odd indeed, but good to hear it works now. Let us know if you replicate the original glitch to help identify what was originally happening!