From baa80ee13a0b9c1b2723c0264494f67025ee90df Mon Sep 17 00:00:00 2001 From: James Maroney Date: Wed, 13 Apr 2016 14:13:37 -0400 Subject: [PATCH] Support working from HTMLImageElements from DOM new Image() and document.querySelector('img') will now both pass this test --- lib/image/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/image/index.js b/lib/image/index.js index 130f7b0..441fca9 100644 --- a/lib/image/index.js +++ b/lib/image/index.js @@ -26,7 +26,7 @@ export function getLoader(resource) { return loadUrl; } - if (resource instanceof Image) { + if (Object.prototype.toString.call(resource) == '[object HTMLImageElement]') { return identity; }