habbes / xaval

Interactive web-based playground for computer vision exploration and experimentation
https://xaval.habbes.xyz
5 stars 0 forks source link

Other file types #66

Closed habbes closed 6 years ago

habbes commented 6 years ago

Addresses #61

Now you can upload arbitrary file blobs into Xaval. To access them, use files.getReader(name), this returns an instance of BinaryFileReader which provides methods for asynchronously retrieving the file contents in different formats (text, data url and array buffer) as well as a .url property containing the object url:

const blob = files.getReader('file1');
blob.readText().then(text => console.log(text));
blob.readBuffer().then(buffer => console.log(buffer));
blob.readDataURL().then(dataUrl => console.log(dataUrl);

// get object url
console.log(blob.url);

getReader() is probably not a good name. Maybe I should rename it to readBinary or readBlob or something else.

Furthermore, these files have blank thumbnails. I will create an issue to address that.