-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
my image screenshot in ios webview is occasionally white, #1995
Comments
the same. try to transform the source image's src to base64, then use html2canvas to generate your image. |
awsome! it works! thanks a lot! |
兄台,请问下如何处理的在ios手机下渲染白屏问题。有点没理解。 |
我的问题是渲染没毛病,但是截图有毛病,上面这位sky网友的意思是你把图片地址转为base64再放上去,试一下看行不行,我的OK |
@boboZh 哥,请教下您知道为什么在ios上渲染不出来dom中的图片么,概率性事件,概率还挺大的。web和安卓都没问题。找了几天都没找到解决方法。 |
这个不清楚诶,没有遇到过 |
the same problem! |
but now, it can reproduce occassionally with base64 src, do you know how to do with this? |
I also found out this, but sorry, I have no idea too. |
Increasing |
2023, the problem still exist in some iphone. |
Bug reports:
my image screenshot in ios webview is occasionally white,
it acts like this "https://img4.easypass.cn/das/carsource1/origin/cac62901-8930-47e3-ac1d-cca42b9e64cc.png",
when add a border to the image, it acts like this, "https://img4.easypass.cn/das/carsource1/origin/d6ea23c2-5f88-44ed-ac74-d2b3c6a73dbd.png"
and here is my code:
Html2Canvas(poster, {
dpi: window.devicePixelRatio * 2,
useCORS: true, // 允许跨域图片
logging: false,
width: width,
height: height,
scale: scale,
canvas: canvas
})
.then(function (canvas) {
let imgBlob = canvas.toDataURL('image/jpg', 1.0)
that._uploadImg(imgBlob)
let shareBase64 = imgBlob.match('data:image/png;base64,') && imgBlob.split('data:image/png;base64,')[1]
that.base64Url = shareBase64
that.$refs.shareWrapper.show(that.shareTextOrigin)
thank you
Specifications:
The text was updated successfully, but these errors were encountered: