-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Support for downloading base64 files #9297
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
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for tiddlywiki-previews ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Confirmed: flibbles has already signed the Contributor License Agreement (see contributing.md) |
📊 Build Size Comparison:
|
Branch | Size |
---|---|
Base (master) | 2418.3 KB |
PR | 2418.6 KB |
Diff: ⬆️ Increase: +0.3 KB
Without this, it seems to be impossible to download an With this, you can flag an |
Added a comment to explain to future coders why we'd use data urls over blobs for base64 tiddlers. I would write tests for this, but I can't think of a way to do it that wouldn't involve a big infrastructure of mocked system methods, and would be rather arbitrary anyway. Since you can only know which download style you want from seeing how they react in the browser. |
I'm fine if this gets rejected, by the way. But then I would say that TW should include $action support for downloading images. tm-download-file should be able to download images without needing to specify that they're base64 encoded (like this PR requires). |
The blob doesn't work for downloading a tiddler type that calls itself out as a base64 type. Using data urls does work.
This change makes it possible to download png and other base64 encoded tiddlers correctly.
It's for TW5-Graph, but it struck me as rather amazing that there does not appear to be any way to download an image tiddler as an actual image. Seems like something SOMEONE would have wanted to do by now.