提交 0576c7c8 编写于 作者: M Mr.doob

ImageLoader: Fixed data: links breakage.

上级 f8e0e542
......@@ -13,12 +13,6 @@ Object.assign( THREE.ImageLoader.prototype, {
load: function ( url, onLoad, onProgress, onError ) {
var image = document.createElement( 'img' );
var loader = new THREE.XHRLoader( this.manager );
loader.setPath( this.path );
loader.setResponseType( 'blob' );
loader.load( url, function ( blob ) {
image.onload = function () {
URL.revokeObjectURL( image.src );
......@@ -26,10 +20,23 @@ Object.assign( THREE.ImageLoader.prototype, {
};
if ( url.indexOf( 'data:' ) === 0 ) {
image.src = url;
} else {
var loader = new THREE.XHRLoader( this.manager );
loader.setPath( this.path );
loader.setResponseType( 'blob' );
loader.load( url, function ( blob ) {
image.src = URL.createObjectURL( blob );
}, onProgress, onError );
}
return image;
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册