Browse Source

Merge pull request #21213 from IsseiMori/dev

Examples: Add gzi encoding option to NRRD Loader
Mr.doob 4 years ago
parent
commit
e99f13ca16
2 changed files with 2 additions and 2 deletions
  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' ) {
+		if ( headerObject.encoding.substring( 0, 2 ) === 'gz' ) {
 
 			// we need to decompress the datastream
 			// here we start the unzipping and get a typed Uint8Array back