Browse Source

Merge pull request #15141 from zprodev/feature/fix-jpeg-check

Fix jpeg check in TextureLoader
Mr.doob 6 years ago
parent
commit
1f6538f293
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/loaders/TextureLoader.js

+ 1 - 1
src/loaders/TextureLoader.js

@@ -31,7 +31,7 @@ Object.assign( TextureLoader.prototype, {
 			texture.image = image;
 			texture.image = image;
 
 
 			// JPEGs can't have an alpha channel, so memory can be saved by storing them as RGB.
 			// JPEGs can't have an alpha channel, so memory can be saved by storing them as RGB.
-			var isJPEG = url.search( /\.jpe?g$/i ) > 0 || url.search( /^data\:image\/jpeg/ ) === 0;
+			var isJPEG = url.search( /\.jpe?g($|\?)/i ) > 0 || url.search( /^data\:image\/jpeg/ ) === 0;
 
 
 			texture.format = isJPEG ? RGBFormat : RGBAFormat;
 			texture.format = isJPEG ? RGBFormat : RGBAFormat;
 			texture.needsUpdate = true;
 			texture.needsUpdate = true;