CollectionFS - Convert FileObject/Image to DataURI?


#1

Situation

I’m using collectionFS with gridFS as the storage adapter.
Uploaded files are just images.

I know i can access the url of an image like so:

var myImageUrl = Images.findOne({...}).url();

Question

Now i need the Image as a DataURI as well.
Is there a way to convert an already stored image to a DataURI?

Something like this would be amazing, but i guess it’s not that simple?

var myImageUrl = Images.findOne({...}).toDataURI();

Any push in the right direction is much appreciated!