Created
August 1, 2016 16:43
-
-
Save icaroharry/0f95010e9dd6570611c00286a231e0c4 to your computer and use it in GitHub Desktop.
I've already tried different ways to construct the blob and the base64 binary, but none of them worked.
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
dropbox.getThumbnail(file.path_lower, 'jpeg', 'w64h64'). | |
then((response) => { | |
console.log(response) | |
//let thumbnailBlob = window.btoa(unescape(encodeURIComponent(response.text))); | |
//file.thumbnailLink = 'data:image/jpeg;base64,' + thumbnailBlob; | |
let arrayBufferView = new Uint32Array(response.text); | |
let thumbnailBlob = new Blob([arrayBufferView], {type: "image/jpeg"}); | |
file.thumbnailLink = window.URL.createObjectURL(thumbnailBlob); | |
console.log(thumbnailBlob); | |
console.log(file.thumbnailLink) | |
}, (err) => reject(err)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment