Commit 1db0c00d5c1029322455ac21c2ef002f981fa59c
fix bugs in avatar editing, and use dataurl-, which avoids readable-stream
Dominic Tarr committed on 7/30/2016, 3:30:29 AMParent: 0b5a32431a545be14a4887d48c7ce5b1eddca8d7
Files changed
modules/avatar-edit.js | changed |
modules/avatar-edit.js | ||
---|---|---|
@@ -1,5 +1,5 @@ | ||
1 | -var dataurl = require('dataurl') | |
1 | +var dataurl = require('dataurl-') | |
2 | 2 | var hyperfile = require('hyperfile') |
3 | 3 | var hypercrop = require('hypercrop') |
4 | 4 | var hyperlightbox = require('hyperlightbox') |
5 | 5 | var h = require('hyperscript') |
@@ -86,19 +86,20 @@ | ||
86 | 86 | hyperfile.asDataURL(function (data) { |
87 | 87 | var el = crop(data, function (err, data) { |
88 | 88 | if(data) { |
89 | 89 | img.src = data |
90 | + var _data = dataurl.parse(data) | |
90 | 91 | pull( |
91 | - pull.once(dataurl.parse(data)), | |
92 | + pull.once(_data.data), | |
92 | 93 | sbot_blobs_add(function (err, hash) { |
93 | 94 | //TODO. Alerts are EVIL. |
94 | 95 | //I use them only in a moment of weakness. |
95 | 96 | |
96 | 97 | if(err) return alert(err.stack) |
97 | 98 | selected = { |
98 | 99 | link: hash, |
99 | - size: selected.data.length, | |
100 | - type: selected.mimetype, | |
100 | + size: _data.data.length, | |
101 | + type: _data.mimetype, | |
101 | 102 | width: 512, |
102 | 103 | height: 512 |
103 | 104 | } |
104 | 105 | |
@@ -144,4 +145,6 @@ | ||
144 | 145 | |
145 | 146 | |
146 | 147 | |
147 | 148 | |
149 | + | |
150 | + |
Built with git-ssb-web