【问题标题】:what is the encoding mode when html converts base64 to imghtml将base64转为img时的编码方式是什么
【发布时间】:2021-08-09 18:31:24
【问题描述】:

我在理解 html 如何将 base64 转换为 img 时遇到了一些麻烦 从https://www.lucidchart.com/techblog/2017/10/23/base64-encoding-a-visual-explanation/我了解了字符串如何转换为base64,但是当base64编码为rgb时会发生什么

【问题讨论】:

    标签: html image base64 frontend encode


    【解决方案1】:

    Base64 是一种将二进制数据编码为文本的方法(因此它可以放在任何可以放置文本的位置,例如 HTML 属性值中)。

    浏览器将 Base64 数据转换成它原来的任何形式。

    如果那是 PNG,它会将其转换回 PNG。如果是 JPEG,则为 JPEG。以此类推。

    浏览器根本不会将 Base64 数据直接转换为像素值。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-12-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-02-06
      • 2011-02-15
      • 2012-05-06
      • 2015-05-30
      相关资源
      最近更新 更多