Use Base64 String from URL in src tag of image

后端 未结 3 2081
别跟我提以往
别跟我提以往 2021-02-06 04:09

I have an service which returns the base64 version of an image. Now i want to use the base64 string in the src tag of an img. The service offers the ba

3条回答
  •  不思量自难忘°
    2021-02-06 04:40

    For base64 encoded .png and .jpg images, to remove single quotes use utf-8 while encoding.

    Example:

    src="data:image/jpeg;base64,iVBORw0KG...."
    

提交回复
热议问题