Răsfoiți Sursa

Merge pull request #21213 from IsseiMori/dev

Examples: Add gzi encoding option to NRRD Loader
Mr.doob 4 ani în urmă
părinte
comite
e99f13ca16
2 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  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 );
 		parseHeader( _header );
 
 
 		var _data = _bytes.subarray( _data_start ); // the data without 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
 			// we need to decompress the datastream
 			// here we start the unzipping and get a typed Uint8Array back
 			// 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 );
 		parseHeader( _header );
 
 
 		var _data = _bytes.subarray( _data_start ); // the data without 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
 			// we need to decompress the datastream
 			// here we start the unzipping and get a typed Uint8Array back
 			// here we start the unzipping and get a typed Uint8Array back