TiddlyWiki / TiddlyWiki5

A self-contained JavaScript wiki for the browser, Node.js, AWS Lambda etc.
https://tiddlywiki.com/
Other
8.02k stars 1.19k forks source link

Support external images in client-server configuration #1000

Open Jermolene opened 10 years ago

Jermolene commented 10 years ago

TiddlyWiki draws a distinction between lazily loaded images and external images:

Both types can be used with the standalone configuration, but currently only lazily loaded images are supported in the client-server configuration (see the script ./bin/lazy.sh). The disadvantage of lazily loaded images is that they still consume JavaScript memory and they are rendered as inline base64 images which are not as performant as images retrieved via HTTP.

The following changes are needed in order to support external images in the client-server configuration:

jayfresh commented 9 years ago

bonus for your 1000'th issue! :+1:

Jermolene commented 9 years ago

@jayfresh thanks, makes me feel old!

danielo515 commented 9 years ago

So those images will be loaded when you open that tiddler? Like in normal Web page navigation?

Jermolene commented 9 years ago

So those images will be loaded when you open that tiddler? Like in normal Web page navigation?

Yes, that's right; in the browser we'd have an ordinary <img> tag with the URL pointing to the image on the server.

rubaboo commented 8 years ago

Discussion at https://groups.google.com/forum/#!topic/tiddlywiki/MBuzDDEpIPw

sukima commented 8 years ago

PR #2502 introduces a static file server module which in theory would fix the relative path problem described in this issue. Just wanted to link the two discussions.

gw commented 4 years ago

Curious about the latest state of this. I run TW5 in standard client-server mode on a VPS and my content's very image-heavy. Would love for the drag-and-drop importer to upload my images to my VPS and create skinny _canonical_uri tiddlers for me.

Happy to take a stab at this if you point me in the right direction.

linonetwo commented 1 year ago

I'm going to do this, currently my nodejs cost 2GB of ram to store images (After importing Evernote and clipping many websites).

The following changes are needed

I will follow your instruction. But those only ask client to load images in the _canonical_uri way. We may need extra modifications to ask server not load binary files' text field into memory at all.

linonetwo commented 1 year ago

@gw That is not we are talking about in this issue. This issue is about automatically add _canonical_uri to image tiddlers "on loading", not "on saving". If you want the later one, you need to use the-file-uploads-plugin

linonetwo commented 1 year ago

Also make sure tiddler with _canonical_uri is using sync-adaptor method to load, not using HTTP directly, because content may store in a SQLite, or has to be loaded via IPC/RPC method that is only accessible in sync-adaptor.


Not necessarily, just use a relative URL, and we can catch the URL call in Electron/React-Native to redirect them to the IPC call.

pmario commented 1 year ago

Also make sure tiddler with _canonical_uri is using sync-adaptor method to load, not using HTTP directly,

This behaviour can not be changed for backwards compatibility reasons. There are configurations, that depend on this behaviour