Browse Source

Add workaround for FireFox creaetImageBitmap() unrecognized options issue in ImageBitmapLoader

Takahiro 6 years ago
parent
commit
a04f8ec4e6
1 changed files with 10 additions and 1 deletions
  1. 10 1
      src/loaders/ImageBitmapLoader.js

+ 10 - 1
src/loaders/ImageBitmapLoader.js

@@ -71,7 +71,16 @@ ImageBitmapLoader.prototype = {
 
 
 		} ).then( function ( blob ) {
 		} ).then( function ( blob ) {
 
 
-			return createImageBitmap( blob, scope.options );
+			if ( scope.options === undefined ) {
+
+				// Workaround for FireFox. It causes an error if you pass options.
+				return createImageBitmap( blob );
+
+			} else {
+
+				return createImageBitmap( blob, scope.options );
+
+			}
 
 
 		} ).then( function ( imageBitmap ) {
 		} ).then( function ( imageBitmap ) {