浏览代码

Merge pull request #12318 from looeee/FBXLoader_base64_image_bug

FbxLoader base64 image parsing error
Mr.doob 7 年之前
父节点
当前提交
a48399690b
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      examples/js/loaders/FBXLoader.js

+ 7 - 0
examples/js/loaders/FBXLoader.js

@@ -261,6 +261,13 @@
 
 		if ( typeof content === 'string' ) {
 
+			// ASCII format sometimes adds an extra character to the end of the content string
+			if ( content.slice( - 1 ) !== '=' ) {
+
+				content = content.slice( 0, - 1 );
+
+			}
+
 			return 'data:' + type + ';base64,' + content;
 
 		} else {