git ssb

16+

Dominic / patchbay



Commit 1db0c00d5c1029322455ac21c2ef002f981fa59c

fix bugs in avatar editing, and use dataurl-, which avoids readable-stream

Dominic Tarr committed on 7/30/2016, 3:30:29 AM
Parent: 0b5a32431a545be14a4887d48c7ce5b1eddca8d7

Files changed

modules/avatar-edit.jschanged
modules/avatar-edit.jsView
@@ -1,5 +1,5 @@
1-var dataurl = require('dataurl')
1+var dataurl = require('dataurl-')
22 var hyperfile = require('hyperfile')
33 var hypercrop = require('hypercrop')
44 var hyperlightbox = require('hyperlightbox')
55 var h = require('hyperscript')
@@ -86,19 +86,20 @@
8686 hyperfile.asDataURL(function (data) {
8787 var el = crop(data, function (err, data) {
8888 if(data) {
8989 img.src = data
90+ var _data = dataurl.parse(data)
9091 pull(
91- pull.once(dataurl.parse(data)),
92+ pull.once(_data.data),
9293 sbot_blobs_add(function (err, hash) {
9394 //TODO. Alerts are EVIL.
9495 //I use them only in a moment of weakness.
9596
9697 if(err) return alert(err.stack)
9798 selected = {
9899 link: hash,
99- size: selected.data.length,
100- type: selected.mimetype,
100+ size: _data.data.length,
101+ type: _data.mimetype,
101102 width: 512,
102103 height: 512
103104 }
104105
@@ -144,4 +145,6 @@
144145
145146
146147
147148
149+
150+

Built with git-ssb-web