[英]Blob URL to image
How can I "save" this image? 我怎样才能“保存”这张图片?
blob:https%3A//theta360.com/473c6400-b8e7-4c41-8f7a-90f03cbc8787
found on: https://theta360.com/s/lE2in9qQDK6j2CcjPAQcvNhOi 发现于: https : //theta360.com/s/lE2in9qQDK6j2CcjPAQcvNhOi
I tried some script I found on SO which uses canvas.toDataURL
我尝试了一些我在SO上找到的使用
canvas.toDataURL
But I get an error: 但是我收到一个错误:
Not allowed to load local resource: blob:https%3A//theta360.com/473c6400-b8e7-4c41-8f7a-90f03cbc8787
不允许加载本地资源:blob:https%3A // theta360.com / 473c6400-b8e7-4c41-8f7a-90f03cbc8787
Javascript: 使用Javascript:
var url = "blob:https%3A//theta360.com/473c6400-b8e7-4c41-8f7a-90f03cbc8787"; // document.getElementById("img1").src; // 'img1' is the thumbnail - I had to put an id on it
var canvas = document.getElementById("MyCanvas");
var img = new Image();
img.src = url;
img.onload = function () {
var myImage = canvas.toDataURL("image/jpg");
document.getElementById("dataurl").value = myImage;
}
HTML: HTML:
<canvas id="MyCanvas">This browser or document mode doesn't support canvas</canvas>
<input id="dataurl" name="dataurl" type="text" size="50" />
It is not possible to request a URL created by URL.createObjectURL()
from a different origin. 无法从其他来源请求
URL.createObjectURL()
创建的URL。 objectURL
exists within the window
that created it for the lifetime of the document
that created it. objectURL
存在于window
,该window
在创建它的document
的生命周期内创建它。
The
URL.createObjectURL()
static method creates aDOMString
containing an URL representing the object given in parameter.URL.createObjectURL()
静态方法创建一个DOMString
其中包含表示参数中给定的对象的URL。 The URL lifetime is tied to thedocument
in the window on which it was created.URL生存期与创建它的窗口中的
document
相关联。 The new object URL represents the specifiedFile
object orBlob
object.新对象URL表示指定的
File
对象或Blob
对象。
I found how to get the image but this does not has anything to do with programming anymore. 我找到了如何获取图像,但这与编程无关。
Look in Chrome's cache with chrome://cache/
and do a search for equirectangular_web_optimized
使用
chrome://cache/
查看Chrome的缓存,然后搜索equirectangular_web_optimized
i did this way to get the props sizes of an BLOB Url (file.localDataUrl) 我这样做是为了获得BLOB Url的道具大小(file.localDataUrl)
const img = new Image();
img.src = file.localDataUrl;
img.onload = (a) => {
console.log(a);
console.log([a.path[0].width, a.path[0].height]);
};
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.