Crear imagen a partir del valor ascii

Soy nuevo base64 images. I have a problem that base64 images are not completely supported in IE8 or lower, with a limitation of 32Kb.

Finally, I got a function to convert base64 imágenes a ascii código usando javascript. However, I am not able to figure out how to show a img usar ascii value of the image.

cuando usamos base64 in img tag we write like this,

<img src="data:image/png;base64,iVBORw0K..." />

Therefore, I need something using which if I have an ascii code of an image, I can display it the similar way I am displaying base64 image image.

preguntado el 12 de febrero de 14 a las 08:02

What do you mean by saying 'ascii code of an image'? -

@PatrickHofman: it is the same text which you will see it you open a .jpg or .png or any other image file in notepad -

Still your question is unclear. Do you mean you need the string representation in base64 of your image bytes? -

no, I have the ascii value of the image, I need to show it on HTML page. <img src="test.jpg" /> src I need to give the ascii value of the image. -

1 Respuestas

I think you misunderstand the limitations of IE8.

IE8 only supports images with a maximum size of 32KB, not 32 bits. The only thing you can do about it is delivering images that are at most 32KB big. Or drop the support for IE8 is that is an option.

In answer of your second question:

set the src attribute of the image using JavaScript:

function changeImage(dataAsBase64String)
    image1.src = 'data:image/png;base64,' + dataAsBase64String;

Respondido 12 Feb 14, 09:02

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.