-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support external images in client-server configuration #1000
Comments
bonus for your 1000'th issue! 👍 |
@jayfresh thanks, makes me feel old! |
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 |
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. |
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 Happy to take a stab at this if you point me in the right direction. |
I'm going to do this, currently my nodejs cost 2GB of ram to store images (After importing Evernote and clipping many websites).
I will follow your instruction. But those only ask client to load images in the |
@gw That is not we are talking about in this issue. This issue is about automatically add |
Also make sure tiddler with 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. |
This behaviour can not be changed for backwards compatibility reasons. There are configurations, that depend on this behaviour |
TiddlyWiki draws a distinction between lazily loaded images and external images:
_canonical_uri
field that gives the URI of the image. This URI is used directly in HTML img tags, without ever loading the body of the image as a tiddler. See http://tiddlywiki.com/#ExternalImages:ExternalImagesBoth 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:
server.js
with simple content negotiation when retrieving tiddlers, enabling it to serve either the current JSON format or the raw resource depending upon what the browser asks for with the "Accept" header<<customSaveTiddlers>>
just before the first closing</div>
in$:/core/templates/store.area.template.html
$:/core/save/lazy-images
that setscustomSaveTiddlers
to a rendering of the current image tiddlers with thetext
field omitted and the_canonical_uri
field added. The latter would be set torecipes/default/tiddlers/<encodedimagetitle>
The text was updated successfully, but these errors were encountered: