[gelöst] base64 encode->decode : 2 Bytes zuviel
Verfasst: Sonntag 5. Oktober 2008, 12:25
out.png ist 2 Bytes größer als in.png - warum?
Code: Alles auswählen
import sys
import base64
f = open("in.png", "rb") # read binary
image = f.read()
f.close()
string = base64.encodestring(image)
image = base64.decodestring(string)
f = open("out.png", "wb") # write binary, too!!
f.write(image)
f.close()