Add base64 image blob support - #2700
Conversation
|
Thanks for offering this PR @awarre, This solves a core current limitation in the API and will be especially useful to those converting & importing content from other formats. I'll go deeper through this soon to finish it off and get it implemented. Have assigned to next feature release but might sneak it into a sooner patch release instead. Some notes primarily for myself to consider while I've been looking into something related to this:
|
- Added test cases to cover. - Altered parsing logic to be a little less reliant on regex. - Added new iamge repo method for creating from data. - Added extension validation and additional type support. - Done some cleanup of common operations within PageContent. - Added message to API docs/method to mention image usage. For #2700 and #2631.
|
Thanks again @awarre, Now all merged after some tweaks in 39928e1. Will be part of the next patch release. I done a quick test using your original test case from your original issue, and it seemed to all work without any edits needed on the JavaScript side of things (The pixel avatar image was uploaded as expected after being pasted as a blob). This was using Firefox on Fedora 34. |
Overview
This allows usage of base64 image blobs in pages by parsing them from posts during submission and saving them as images. This ties almost entirely into existing code.
Based on our discussion in #2631, I think this solution would be preferable.
Benefits
Even if this exact pull request isn't accepted, a solution with this design has many benefits.
TODO