old_contents: /**
   * @author mrdoob / http://mrdoob.com/
   */
  
  THREE.TextureLoader = function ( manager ) {
  
  	this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;
  
  };
  
  Object.assign( THREE.TextureLoader.prototype, {
  
  	load: function ( url, onLoad, onProgress, onError ) {
  
  		var texture = new THREE.Texture();
  
  		var loader = new THREE.ImageLoader( this.manager );
  		loader.setCrossOrigin( this.crossOrigin );
  		loader.setPath( this.path );
  		loader.load( url, function ( image ) {
  
  			texture.image = image;
  			texture.needsUpdate = true;
  
  			if ( onLoad !== undefined ) {
  
  				onLoad( texture );
  
  			}
  
  		}, onProgress, onError );
  
  		return texture;
  
  	},
  
  	setCrossOrigin: function ( value ) {
  
  		this.crossOrigin = value;
  		return this;
  
  	},
  
  	setPath: function ( value ) {
  
  		this.path = value;
  		return this;
  
  	}
  
  } );
  
new_contents: /**
   * @author mrdoob / http://mrdoob.com/
   */
  
  THREE.TextureLoader = function ( manager ) {
  
  	this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;
  
  };
  
  Object.assign( THREE.TextureLoader.prototype, {
  
  	load: function ( url, onLoad, onProgress, onError ) {
  
  		var texture = new THREE.Texture();
  
  		var loader = new THREE.ImageLoader( this.manager );
  		loader.setCrossOrigin( this.crossOrigin );
  		loader.setPath( this.path );
  		loader.load( url, function ( image ) {
  
  			// JPEGs can't have an alpha channel, so memory can be saved by storing them as RGB.
  			var isJPEG = url.search(/\.(jpg|jpeg)$/) > 0;
  			if (!isJPEG) {
  				isJPEG = url.search(/^data\:image\/jpeg/) == 0;
  			}
  			texture.format = isJPEG ? THREE.RGBFormat : THREE.RGBAFormat;
  			texture.image = image;
  			texture.needsUpdate = true;
  
  			if ( onLoad !== undefined ) {
  
  				onLoad( texture );
  
  			}
  
  		}, onProgress, onError );
  
  		return texture;
  
  	},
  
  	setCrossOrigin: function ( value ) {
  
  		this.crossOrigin = value;
  		return this;
  
  	},
  
  	setPath: function ( value ) {
  
  		this.path = value;
  		return this;
  
  	}
  
  } );
  
subject: Save memory by loading JPEGs as RGB by default (#9203)