Explorar el Código

Examples: Modify NRRDLoader.js to accept variations of the gzip encoding option

IsseiMori hace 4 años
padre
commit
d6cb2060fe
Se han modificado 2 ficheros con 2 adiciones y 2 borrados
  1. 1 1
      examples/js/loaders/NRRDLoader.js
  2. 1 1
      examples/jsm/loaders/NRRDLoader.js

+ 1 - 1
examples/js/loaders/NRRDLoader.js

@@ -309,7 +309,7 @@ THREE.NRRDLoader.prototype = Object.assign( Object.create( THREE.Loader.prototyp
 		parseHeader( _header );
 
 		var _data = _bytes.subarray( _data_start ); // the data without header
-		if ( headerObject.encoding === 'gzip' || headerObject.encoding === 'gz' ) {
+		if ( headerObject.encoding.substring( 0, 2 ) === 'gz' ) {
 
 			// we need to decompress the datastream
 			// here we start the unzipping and get a typed Uint8Array back

+ 1 - 1
examples/jsm/loaders/NRRDLoader.js

@@ -318,7 +318,7 @@ NRRDLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 		parseHeader( _header );
 
 		var _data = _bytes.subarray( _data_start ); // the data without header
-		if ( headerObject.encoding === 'gzip' || headerObject.encoding === 'gz' || headerObject.encoding === 'gzi' ) {
+		if ( headerObject.encoding.substring( 0, 2 ) === 'gz' ) {
 
 			// we need to decompress the datastream
 			// here we start the unzipping and get a typed Uint8Array back