Support data url scheme
It would be really cool to add support for data url for cases where the files don't physically exist on the file system and there are only a data url strings.
For security reasons, you can disable this functionality by default and enable it only if there is a feature flag (ex. WEBP_DATA_URL_ENABLED).
there is example of parsing
Currently I use the following algorithm:
- receive POST data
- decode the "content" of each key with data url string
- write "content" to disk
- send a request to the webp service
- receive a response with webp file
- write the webp file to disk
- delete the file with the original "content"
As you can see, with the support of data urls, my algorithm could be greatly simplified.
Good idea! @vanodevium , let's see if we can add this feature in future versions. cc @BennyThink
@n0vad3v @BennyThink
I thought of another important thing: since the data url can be a very long string, maybe you should provide the ability to make post requests to the webp.
Agreed.