write utf8 una txt manejo linea leer lectura importar funcion especifica escritura como binarios archivos archivo acentos python image

utf8 - manejo de archivos binarios en python



Convierta una cadena en base64 en una imagen y guárdela en el sistema de archivos en Python (4)

Empezando con

img_data = b''iVBORw0KGgoAAAANSUhEUgAABoIAAAaCCAYAAAABZu+EAAAqOElEQVR42uzBAQEAAACAkP6v7ggK/nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/nAAAAAAAAAAAAAAAAAIcAeHkAAeLqlDIAAAAASUVORK5CYII=''

Decodificó los datos utilizando el códec base64 y luego los escribió en el sistema de archivos.

# In Python 2.7 fh = open("imageToSave.png", "wb") fh.write(img_data.decode(''base64'')) fh.close() # or, more concisely using with statement with open("imageToSave.png", "wb") as fh: fh.write(img_data.decode(''base64''))

Modernizando este ejemplo a Python 3, que eliminó el soporte de códec arbitrario de las .encode() string / bytes .encode() y .decode() :

# For both Python 2.7 and Python 3.x import base64 with open("imageToSave.png", "wb") as fh: fh.write(base64.decodebytes(img_data))

Tengo una cadena en formato base64, que representa una imagen PNG. ¿Hay alguna manera de guardar esta imagen en el sistema de archivos, como un archivo PNG?

Codifiqué la imagen usando flexión. En realidad, esto es lo que obtengo en el servidor (no puedo ver ninguna imagen después de cualquiera de los métodos propuestos :()

iVBORw0KG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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/nAAAAAAAAAAAAAAAAAIcAeHkAAeLqlDIAAAAASUVORK5CYII=


Probablemente pueda usar el objeto png.Reader del paquete png.Reader para hacer esto: decodifique la cadena base64 en una cadena regular (a través de la biblioteca estándar base64 ) y páselo al constructor.


Si el imagestr era datos de mapa de bits (que ahora sabemos que no es), podrías usar esto

imagestr es la cadena codificada en base64
width es el ancho de la imagen
height es la altura de la imagen

from PIL import Image from base64 import decodestring image = Image.fromstring(''RGB'',(width,height),decodestring(imagestr)) image.save("foo.png")

Dado que el imagestr es solo el codificado de datos png

from base64 import decodestring with open("foo.png","wb") as f: f.write(decodestring(imagestr))


También puede guardarlo en un buffer de cadena y luego hacer lo que desee con él,

import cStringIO data = json.loads(request.POST[''imgData'']) # Getting the object from the post request image_output = cStringIO.StringIO() image_output.write(data.decode(''base64'')) # Write decoded image to buffer image_output.seek(0) # seek beginning of the image string # image_output.read() # Do as you wish with it!

En django, puede guardarlo como un archivo cargado para guardar en un modelo:

from django.core.files.uploadedfile import SimpleUploadedFile suf = SimpleUploadedFile(''uploaded_file.png'', image_output.read(), content_type=''image/png'')

O enviarlo como un correo electrónico:

email = EmailMessage(''Hello'', ''Body goes here'', ''[email protected]'', [''[email protected]'', ]) email.attach(''design.png'', image_output.read(), ''image/png'') email.send()