{"action":"created","issue":{"url":"https://api.github.com/repos/valor-software/ng2-file-upload/issues/617","repository_url":"https://api.github.com/repos/valor-software/ng2-file-upload","labels_url":"https://api.github.com/repos/valor-software/ng2-file-upload/issues/617/labels{/name}","comments_url":"https://api.github.com/repos/valor-software/ng2-file-upload/issues/617/comments","events_url":"https://api.github.com/repos/valor-software/ng2-file-upload/issues/617/events","html_url":"https://github.com/valor-software/ng2-file-upload/issues/617","id":205287474,"number":617,"title":"Is it possible to upload a base64 image?","user":{"login":"surfercoder","id":20744871,"avatar_url":"https://avatars3.githubusercontent.com/u/20744871?v=4","gravatar_id":"","url":"https://api.github.com/users/surfercoder","html_url":"https://github.com/surfercoder","followers_url":"https://api.github.com/users/surfercoder/followers","following_url":"https://api.github.com/users/surfercoder/following{/other_user}","gists_url":"https://api.github.com/users/surfercoder/gists{/gist_id}","starred_url":"https://api.github.com/users/surfercoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/surfercoder/subscriptions","organizations_url":"https://api.github.com/users/surfercoder/orgs","repos_url":"https://api.github.com/users/surfercoder/repos","events_url":"https://api.github.com/users/surfercoder/events{/privacy}","received_events_url":"https://api.github.com/users/surfercoder/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2017-02-03T22:32:29Z","updated_at":"2017-07-25T22:27:46Z","closed_at":null,"body":"Hi there,\r\n\r\nI know you have already touched this topic but I think that my case in a special one.\r\n\r\nI am using the ng2-img-cropper Component, which allows you to get a smaller and lighter image from the original one.\r\n\r\nInside the image property, after cropping you get the resulting base64 string of the cropped image.\r\n\r\nWhat I want to do is in my uploder object add this base64 image to the queue, so after that I will be allowed to invoke the uploader.queue[0].upload() function.\r\n\r\nI am bugging you with this since we will be working with several images with different sizes, such as cover images, profile images/thumbnails and companies logos just to mention a few of them, and as you can imagine it would be quite nice if we can save some net traffic and also storage just saving the image we have cropped and not the initial one.\r\n\r\nI have tried creating an Image from the base64 string and assign it directly but I am always getting an exception\r\n\r\nAny kind of help on this will be more than appreciated.\r\n\r\nBest regards."},"comment":{"url":"https://api.github.com/repos/valor-software/ng2-file-upload/issues/comments/317891576","html_url":"https://github.com/valor-software/ng2-file-upload/issues/617#issuecomment-317891576","issue_url":"https://api.github.com/repos/valor-software/ng2-file-upload/issues/617","id":317891576,"user":{"login":"Boffka","id":1787033,"avatar_url":"https://avatars1.githubusercontent.com/u/1787033?v=4","gravatar_id":"","url":"https://api.github.com/users/Boffka","html_url":"https://github.com/Boffka","followers_url":"https://api.github.com/users/Boffka/followers","following_url":"https://api.github.com/users/Boffka/following{/other_user}","gists_url":"https://api.github.com/users/Boffka/gists{/gist_id}","starred_url":"https://api.github.com/users/Boffka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Boffka/subscriptions","organizations_url":"https://api.github.com/users/Boffka/orgs","repos_url":"https://api.github.com/users/Boffka/repos","events_url":"https://api.github.com/users/Boffka/events{/privacy}","received_events_url":"https://api.github.com/users/Boffka/received_events","type":"User","site_admin":false},"created_at":"2017-07-25T22:27:46Z","updated_at":"2017-07-25T22:27:46Z","body":"Solved!\r\nUse [dom-to-image](https://github.com/tsayen/dom-to-image)\r\n`let node = document.getElementById('cropedimage');\r\ndomtoimage.toBlob(node)\r\n      .then((blob) => {\r\n        let files = [];\r\n        files.push(blob);\r\n        this.uploader.addToQueue(files);\r\n        this.uploader.uploadAll();\r\n      });\r\n`"}}
{"actor":{"display_login":"Boffka"}}