Last active
January 2, 2016 12:29
-
-
Save cramhead/8303724 to your computer and use it in GitHub Desktop.
load image into CollectionFS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fs = Npm.require('fs'); | |
var loadImages = function() { | |
var assets_folder = getAssetPath(); | |
var image = fs.readFileSync(assets_folder + '/20131022_GR-Limited-Edition.jpg', 'binary'); | |
//fs.writeFileSync('/Users/cram/Desktop/test.jpg', image, {encoding: 'binary', mode: 777}); | |
var saved = Images.storeBuffer('20131022_GR-Limited-Edition.jpg', image, {encoding: 'binary', noProgress: true, contentType: 'image/jpeg'}); | |
}; | |
loadImages(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment