/**
 * @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;

	}

} );

@@ -490,16 +490,293 @@
 ge ) %7B%0A%0A
+%09%09%09// JPEGs can't have an alpha channel, so memory can be saved by storing them as RGB.%0A%09%09%09var isJPEG = url.search(/%5C.(jpg%7Cjpeg)$/) %3E 0;%0A%09%09%09if (!isJPEG) %7B%0A%09%09%09%09isJPEG = url.search(/%5Edata%5C:image%5C/jpeg/) == 0;%0A%09%09%09%7D%0A%09%09%09texture.format = isJPEG ? THREE.RGBFormat : THREE.RGBAFormat;%0A
 %09%09%09textu

Save memory by loading JPEGs as RGB by default (#9203)