Created
May 28, 2015 10:48
-
-
Save AlexKMDev/085eed6dca9a8c55857a to your computer and use it in GitHub Desktop.
convert base64-encoded png to binary
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'base64' | |
unless ARGV.first.nil? | |
file = File.new ARGV.first, 'r' | |
encoded = file.gets | |
decoded = Base64.decode64 encoded | |
file.close | |
output = File.new "#{ARGV.first}.png", 'w' | |
output.write decoded | |
output.close | |
else | |
print 'no file' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment