-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The old code didn't accept promises containing blobs which cause issues when working with canvas. There are two ways to get a binary content from a canvas: `canvas.toDataURL()` and `canvas.toBlob()`. Working with the first one involves a substring to remove the data url part and a base64 decode. The other one ends up with a Promise[Blob], fixed by this commit. Now, we can extract the binary content of a canvas like: ```js var p = new JSZip.external.Promise(function (resolve, reject) { canvas.toBlob(function (blob) { resolve(blob); }); }); ```
- Loading branch information
1 parent
3a4a815
commit af944ad
Showing
2 changed files
with
57 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You can pretty much just do
return data.arrayBuffer()
now days and not have to deal with the FileReader