【发布时间】: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
我在理解 html 如何将 base64 转换为 img 时遇到了一些麻烦 从https://www.lucidchart.com/techblog/2017/10/23/base64-encoding-a-visual-explanation/我了解了字符串如何转换为base64,但是当base64编码为rgb时会发生什么
【问题讨论】:
标签: html image base64 frontend encode
Base64 是一种将二进制数据编码为文本的方法(因此它可以放在任何可以放置文本的位置,例如 HTML 属性值中)。
浏览器将 Base64 数据转换成它原来的任何形式。
如果那是 PNG,它会将其转换回 PNG。如果是 JPEG,则为 JPEG。以此类推。
浏览器根本不会将 Base64 数据直接转换为像素值。
【讨论】: