简体   繁体   English

PNG 转 Base64 将图像背景变成黑色

[英]Png to Base64 turns image background black

We have a very old application that converts HTML page to Word file (.doc).我们有一个非常古老的应用程序,可以将 HTML 页面转换为 Word 文件 (.doc)。 Recently we added an image in the page and after saving as .doc , image background turns black.最近我们在页面中添加了一张图片,保存为 .doc 后,图片背景变黑了。 Image was a .png one and converted to base64 format.图像是 .png 格式并转换为 base64 格式。

The code is something like below.代码如下所示。 Can anyone explain what may be the reason and any steps to solve either via code or by MSWORD settings?任何人都可以解释可能是什么原因以及通过代码或 MSWORD 设置解决的任何步骤吗?

 <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...UVORK5CYII=" width="250" height ="100" />

Is this image missing?这张图不见了? Perhaps the blank is indicative of a missing image/'texture'.也许空白表示缺少图像/“纹理”。 You could upload the image to discord and copy the link so that the image can always be found online.您可以上传图像以不和谐并复制链接,以便始终可以在线找到图像。

Perhaps these forums have the answer you're looking for?也许这些论坛有您正在寻找的答案? https://answers.microsoft.com/en-us/msoffice/forum/all/saving-images-in-html-documents/948a796d-36a9-4307-af81-3414d89951ba https://answers.microsoft.com/en-us/msoffice/forum/all/saving-images-in-html-documents/948a796d-36a9-4307-af81-3414d89951ba

https://www.techrepublic.com/pictures/save-images-in-microsoft-word-documents-as-separate-files/ https://www.techrepublic.com/pictures/save-images-in-microsoft-word-documents-as-separate-files/

What about?... "This most commonly occurs when an image has an embedded CMYK Color Profile & is inserted into a document saved in the .doc file type. The same JPEG saved either in RGB Color Mode or saved without an embedded CMYK profile probably would work fine. PNG supports only RGB color mode. "怎么样?...“当图像具有嵌入的 CMYK 颜色配置文件并插入到以 .doc 文件类型保存的文档中时,最常发生这种情况。以 RGB 颜色模式保存的相同 JPEG 或没有嵌入的 CMYK 配置文件保存可能会正常工作。PNG 仅支持 RGB 颜色模式。”

We need more details.我们需要更多细节。 Thank you.谢谢你。 :)) :))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM