Skip to content

Commit

Permalink
fix bug:: window-scoped problem . The File|Blob object passed from pa…
Browse files Browse the repository at this point in the history
…rent window.
  • Loading branch information
BPing committed Nov 15, 2016
1 parent 04f41af commit 41884e1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions js/canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,10 @@
image.src = obj.src;
return;
}
// file
if (obj instanceof File || obj instanceof Blob) {
// file the File|Blob object maybe come from parent's window.
if (obj instanceof File
|| obj instanceof Blob
||(parent&&parent.window&&(obj instanceof parent.window.File||obj instanceof parent.window.Blob))) {
var reader = new FileReader();
reader.onload = function(event) {
image.src = event.target.result;
Expand Down

0 comments on commit 41884e1

Please sign in to comment.