|
@@ -50,10 +50,14 @@ class DepthImageSampler extends THREE.EventDispatcher{
|
|
|
this.canvas.width = img.width
|
|
|
this.canvas.height = img.height
|
|
|
this.context.drawImage(img, 0, 0)
|
|
|
- let data = this.context.getImageData(0, 0, img.width , img.height ).data; //getImageData 1px时 : pc chrome 耗时0.01毫秒左右(排除第一次的50) , 但firefox: 4。但换贴图之后就多达5甚至几十
|
|
|
+ let o = this.context.getImageData(0, 0, img.width , img.height )
|
|
|
+ let data = o && o.data; //getImageData 1px时 : pc chrome 耗时0.01毫秒左右(排除第一次的50) , 但firefox: 4。但换贴图之后就多达5甚至几十
|
|
|
//console.log('changeImg',pano.id )
|
|
|
//this.img = img
|
|
|
-
|
|
|
+ if(!data){
|
|
|
+ console.error('getImageData 得不到?!why!')
|
|
|
+ return false
|
|
|
+ }
|
|
|
|
|
|
if(this.imgDatas.length >= this.maxDataCount){
|
|
|
let old = this.imgDatas.find(e=>!this.nearPanos.includes(e.pano))
|