Pass Base64 jpeg image to og:image

前端 未结 2 649
灰色年华
灰色年华 2020-12-10 05:21

I have image that is being generated in runtime on my website and I display it in html using

         


        
相关标签:
2条回答
  • 2020-12-10 05:58

    Open Graph needs an URL.

    You could try saving your base64 as a temp image.

    0 讨论(0)
  • 2020-12-10 06:05

    pase it to a php file that echo it out:

    <meta property='og:image' content='decoder.php?data=<!-- base64 data -->'/>
    

    decoder.php:

    <?php
        echo base64_decode($_GET['data']);
    ?>
    

    EDIT make sure you check source for security reason.

    0 讨论(0)
提交回复
热议问题