From e93807ade2fc218aff1916eb27b0b276c3b3835a Mon Sep 17 00:00:00 2001 From: Solly Ross Date: Tue, 22 Dec 2015 15:16:52 -0500 Subject: [PATCH] Fix ImageData Constructor Support Detection Our support detection for the `ImageData(data, width, height)` constructor would fail in certain browsers because the size of a 1x1 ImageData's Uint8ClampedArray is 4, not 1. --- include/display.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/display.js b/include/display.js index a492817..a6a5722 100644 --- a/include/display.js +++ b/include/display.js @@ -17,7 +17,7 @@ var Display; var SUPPORTS_IMAGEDATA_CONSTRUCTOR = false; try { - new ImageData(new Uint8ClampedArray(1), 1, 1); + new ImageData(new Uint8ClampedArray(4), 1, 1); SUPPORTS_IMAGEDATA_CONSTRUCTOR = true; } catch (ex) { // ignore failure