0

A pictures'upload and display html-based function.

part of html code like this:

<img src="" alt="Waiting" id="main-pre">

and part of js code:

$('#main-pre').attr('src', 'data:image/jpeg;base64,'+img_data);

"img_data" is the content of picture's base64.

when pic's format is jpg/png/gif/bmp, it's all fine, but when it goes to tif format, the tag can't display the pic.

I noticed tif's base64 code is very much longer than other formats, is this the reason? can't handle this, or what? I can't figure this out.

thx for your time

romlym
  • 561
  • 1
  • 7
  • 26
  • Possible duplicate of [How to convert an image to base64 encoding?](https://stackoverflow.com/questions/3967515/how-to-convert-an-image-to-base64-encoding) – core114 Oct 10 '17 at 08:51
  • The general web page does not support the tif format, similar questions https://stackoverflow.com/questions/2176991/display-tiff-image-in-all-web-browser – dai Oct 10 '17 at 09:05
  • 2
    Possible duplicate of [Convert PNG Base-64 string to TIFF Base-64 string](https://stackoverflow.com/questions/30488116/convert-png-base-64-string-to-tiff-base-64-string) – Andrzej Smyk Oct 10 '17 at 09:06
  • 2
    @romlym if you think that none of use has not understood this question maybe edit it and point out more clearly what would you like to achieve? Under my link is explained that tif format is not supported – Andrzej Smyk Oct 10 '17 at 09:28

0 Answers0