diff --git a/demoassets/main.js b/demoassets/main.js index d79b193..18c925b 100644 --- a/demoassets/main.js +++ b/demoassets/main.js @@ -25,12 +25,12 @@ $(function(){ var droppedImage = new Image(); var fileReader = new FileReader(); - + fileReader.onload = function (event) { droppedImage.src = event.target.result; $target.html(droppedImage); }; - + fileReader.readAsDataURL(file); onDrop(file); @@ -143,7 +143,11 @@ $(function(){ $('#dropzone2').html(''); $.when(done, dtwo).done(function(file, file1){ - resembleControl = resemble(file).compareTo(file1).onComplete(onComplete); + if (typeof FileReader === 'undefined') { + resembleControl = resemble('demoassets/People.jpg').compareTo('demoassets/People2.jpg').onComplete(onComplete); + } else { + resembleControl = resemble(file).compareTo(file1).onComplete(onComplete); + } }); return false; diff --git a/resemble.js b/resemble.js index 2bccf5e..7adb337 100644 --- a/resemble.js +++ b/resemble.js @@ -271,8 +271,9 @@ URL: https://github.com/Huddle/Resemble.js var d; var a; - if(typeof data[offset] !== 'undefined'){ - r = data[offset]; + r = data[offset]; + + if(typeof r !== 'undefined'){ g = data[offset+1]; b = data[offset+2]; a = data[offset+3];