Important Notice: We're experiencing email notification issues. If you've posted a question in the community forums recently, please check your profile manually for responses while we're working to fix this.

On Monday the 3rd of March, around 5pm UTC (9am PT) users may experience a brief period of downtime while one of our underlying services is under maintenance.

Cerca nel supporto

Attenzione alle mail truffa. Mozilla non chiederà mai di chiamare o mandare messaggi a un numero di telefono o di inviare dati personali. Segnalare qualsiasi attività sospetta utilizzando l'opzione “Segnala abuso”.

Ulteriori informazioni

Questa discussione è archiviata. Inserire una nuova richiesta se occorre aiuto.

base64 image not displaying properly

  • 4 risposte
  • 11 hanno questo problema
  • 1 visualizzazione
  • Ultima risposta di cor-el

more options

I have a small Qt/C++ Program which converts the png images to base64 strings i use that string to display images on my webpage...

this data works fine on Google Chrome and other webkit based browsers but on FireFox it just shows upper part of the image and rest of the image is empty/blank....

is there any special method I have to follow in "< img src = .... / >" tag while displaying the base64 data on fire fox

currently I am doing is < img src =" data:image/png;base64;charset=utf-8,ivr......." / >

I have a small Qt/C++ Program which converts the png images to base64 strings i use that string to display images on my webpage... this data works fine on Google Chrome and other webkit based browsers but on FireFox it just shows upper part of the image and rest of the image is empty/blank.... is there any special method I have to follow in "< img src = .... / >" tag while displaying the base64 data on fire fox currently I am doing is''' < img src =" data:image/png;base64;charset=utf-8,ivr......." / >'''

Modificato da abhishekworld il

Tutte le risposte (4)

more options

why was the image not displaying properly on facebook?

more options

Does it work if you use: "data:image/png;base64,ivr......." ?

Does that base64 data have embedded line breaks?

Make sure that it is one long line.

You can also try to convert via this online site.

http://www.motobit.com/util/base64-decoder-encoder.asp
more options

This is exactly what I am trying i have a PHP code

post.php http://pastebin.com/WqnwphQq this returns one small xml which contents base64 data ... which I am calling from AJAX post this is my java script http://pastebin.com/C0zppqsR

the output of ele.firstChild.nodeValue is different in firefox and chrome

I can see that the string which we get in firefox is totally change form the actual generated PHP response (I have checked it using firebug )... any pointers ?? i have attached the sample image

more options

Firefox also stores line breaks as text nodes in the DOM, so it is possible that ele.firstChild is a text node and not the node that you expect.
You may need to walk the DOM tree and check that the nodeType is 1 and not 3

You can check that in the DOM Inspector.

DOM Inspector: https://addons.mozilla.org/firefox/addon/6622