Mozilla 도움말 검색

고객 지원 사기를 피하세요. 저희는 여러분께 절대로 전화를 걸거나 문자를 보내거나 개인 정보를 공유하도록 요청하지 않습니다. "악용 사례 신고"옵션을 사용하여 의심스러운 활동을 신고해 주세요.

자세히 살펴보기

base64 image not displaying properly

  • 4 답장
  • 11 이 문제를 만남
  • 1 보기
  • 최종 답변자: 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......." / >'''

글쓴이 abhishekworld 수정일시

모든 댓글 (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