据说HTML Canvas Element Interface Gecko DOM Reference页面,即:
If the requested type is image/jpeg, then the second argument, if it is between 0.0 and 1.0, is treated as indicating image quality; if the second argument is anything else, the default value for image quality is used. Other arguments are ignored.
但在实践中我得到:安全错误”代码:“1000。
是否尚不支持某些功能?或者为什么会发生这种情况?任何有见地的建议或解释可能会有所帮助。
更新:
我使用最新的文件 API 首先将本地镜像文件加载到内存中,使用 Canvas 对其进行缩放,然后以自定义质量导出。
最佳答案
这是一个 known bug .
关于image - 在 canvas.toDataUrl ('image/jpeg' 、0.2) 上出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4591349/