Comments (10)
Are there still problems with svg+xml inline image decoding in Safari? The simple example I tested seems to be normal
modern-screenshot: 4.4.15
https://codepen.io/qq15725/pen/PoBbOWm
You need to see how the font is imported. Is there a warning of CORS
from modern-screenshot.
And in Safari, it takes three calls to domToCanvas to upload the image correctly
from modern-screenshot.
Thanks for the quick reply.
The issue of calling and saving the image multiple times is not a pressing issue for me at the moment - the library is fast enough for me to call it 3 times. (I'll try to reproduce the symptoms with codepen or something later).
The more pressing issue for me is
I'm currently developing a webapp made with Nextjs and wrapped in Flutter.
I'm using native webviews.
On the iPhone mobile webview, when I apply scale, it doesn't work and I get a degraded quality. Same thing when I give quality to 1.
I have to save it in high quality now.
Could you please give me some whiteness in this regard?
from modern-screenshot.
Oh and by the way, the font is fixed, thanks.
from modern-screenshot.
then
canvas.toDataURL('image/png', 1)
canvas should only export png like this
from modern-screenshot.
The canvas default dpi is 96 which is probably your problem
from modern-screenshot.
const canvas = await domToCanvas(node, {
scale: 3,
backgroundColor: 'white',
drawImageInterval: 1000,
quality: 1,
});
if (checkWebApp()) {
const result = await saveImageToGallery(canvas.toDataURL('image/png', 1));
if (result === undefined) {
setToast({
content: '오류가 발생했습니다.',
});
return;
}
setToast({
content: '저장되었습니다.',
});
return;
} else {
FileSaver(canvas.toDataURL('image/png', 1));
}
Above is my code.
scale doesn't work on mobile webview
It works fine in desktop safari.
from modern-screenshot.
As I continue to test, the issue with degradation seems to be more about quality than scale.
It only happens on the iPhone mobile webview.
from modern-screenshot.
You can also try domToPng
, I will handle png dpi
value based on scale
origin width: 1280
origin height: 105.5
scale: 4
output width: 5120
output height: 422
dpi: 384
from modern-screenshot.
Thank you, strangely it looks degraded in the iPhone gallery but when I put it on Instagram it looks fine. thank you!!!
from modern-screenshot.
Related Issues (20)
- 请问如何生成底色为白色的图片🙋🏻♀️
- 圆角无法画出
- Checkbox, Radio, Select not rendering their state HOT 1
- 截取的图片顶部偏移、和左偏移很大
- Unexpected wrap caused by lost floating point precision HOT 1
- 使用domToPng在特定的OPPO Find X3等机型上,对包含图片类的dom截图处理后发现图片区域为灰色 HOT 1
- Anyway to omit so many console warnings?
- unable to render scrolling position HOT 2
- Remove
- 能不能不要加载css中的所有字体
- Question: is it possible for me to x, y locations of the cloned nodes and its children? HOT 1
- Fonts not getting exported in the img ? HOT 1
- 新版火狐浏览器下内容多时使用domToCanvas提示Failed image load ,图片黑屏 HOT 1
- onCloneNode回调内修改样式以及追加dom元素后,截图没有效果,应当等待onCloneNode回调执行完毕后,再继续执行截图
- Im getting low quality when exporting with domToJpeg and domToBlob
- 内容显示偏移
- 文字的字体没有在截图的图片中 HOT 2
- 如何添加多个dom节点,实现模块化截图 HOT 1
- CSS attr() in pseudo-elements doesn't work in Firefox
- Threads not closing after converting DOM to image
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modern-screenshot.