I have a file containing a svg image which is base64 encoded (data-uri). The file starts with
data:image/svg+xml;base64,PHN....
How to decode this to a .svg file in linux ?
To decode a file with contents that are base64 encoded, you simply provide the path of the file with the --decode flag. As with encoding files, the output will be a very long string of the original file. You may want to output stdout directly to a file.
Decode Base64 to Image To convert a Base64 String into Image, we need to do 2 steps: use base64Decode() function which is shorthand for base64. decode() to decode Base64 to bytes . Uint8List base64Decode(String source) => base64.
You can copy/paste the string (data:image
etc included) in the url bar of a modern browser; it will decrypt it for you, then you can simply save the page as an svg.
You could use an online base64 decoder, such as http://www.base64decode.org/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With