{"action":"created","issue":{"url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/issues/180","repository_url":"https://api.github.com/repos/VeliovGroup/Meteor-Files","labels_url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/issues/180/labels{/name}","comments_url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/issues/180/comments","events_url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/issues/180/events","html_url":"https://github.com/VeliovGroup/Meteor-Files/issues/180","id":169759018,"number":180,"title":"How can I create a thumbnail (using gridFS)","user":{"login":"jbg77","id":19436999,"avatar_url":"https://avatars.githubusercontent.com/u/19436999?v=3","gravatar_id":"","url":"https://api.github.com/users/jbg77","html_url":"https://github.com/jbg77","followers_url":"https://api.github.com/users/jbg77/followers","following_url":"https://api.github.com/users/jbg77/following{/other_user}","gists_url":"https://api.github.com/users/jbg77/gists{/gist_id}","starred_url":"https://api.github.com/users/jbg77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbg77/subscriptions","organizations_url":"https://api.github.com/users/jbg77/orgs","repos_url":"https://api.github.com/users/jbg77/repos","events_url":"https://api.github.com/users/jbg77/events{/privacy}","received_events_url":"https://api.github.com/users/jbg77/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-06T18:14:29Z","updated_at":"2016-08-06T19:40:57Z","closed_at":null,"body":"Hello, I'm using the code on [ wiki GridFS](https://github.com/VeliovGroup/Meteor-Files/wiki/GridFS-Integration).\r\nHow can I using this code : [Image processing](https://github.com/VeliovGroup/Meteor-Files/blob/master/demo/server/image-processing.coffee) to create a thumbnail ?\r\n\r\nI try to do this with cfs:graphicsmagick\r\n```\r\ncreateThumbnails = function(collection, fileRef){\r\n  const cropName = fileRef.path + \"__thumbnail__.png\"\r\n  var image = gm(fileRef.path);\r\n  writeStream = fs.createWriteStream(cropName);\r\n  image.resize('25','25').stream().pipe(writeStream);\r\n  const upd = {\r\n       $set: {\r\n        \"versions.thumbnail\" : {\r\n           path: cropName,\r\n           type: \"image/png\",\r\n           extension: \"png\"\r\n          } \r\n     } ;\r\n\r\n  console.log(\"thumb generated\");\r\n  return collection.update( fileRef._id, upd );\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/issues/comments/238045119","html_url":"https://github.com/VeliovGroup/Meteor-Files/issues/180#issuecomment-238045119","issue_url":"https://api.github.com/repos/VeliovGroup/Meteor-Files/issues/180","id":238045119,"user":{"login":"dr-dimitru","id":1686778,"avatar_url":"https://avatars.githubusercontent.com/u/1686778?v=3","gravatar_id":"","url":"https://api.github.com/users/dr-dimitru","html_url":"https://github.com/dr-dimitru","followers_url":"https://api.github.com/users/dr-dimitru/followers","following_url":"https://api.github.com/users/dr-dimitru/following{/other_user}","gists_url":"https://api.github.com/users/dr-dimitru/gists{/gist_id}","starred_url":"https://api.github.com/users/dr-dimitru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dr-dimitru/subscriptions","organizations_url":"https://api.github.com/users/dr-dimitru/orgs","repos_url":"https://api.github.com/users/dr-dimitru/repos","events_url":"https://api.github.com/users/dr-dimitru/events{/privacy}","received_events_url":"https://api.github.com/users/dr-dimitru/received_events","type":"User","site_admin":false},"created_at":"2016-08-06T19:40:57Z","updated_at":"2016-08-06T19:40:57Z","body":"Don't you overwrite original file here?:\r\n```js\r\nimage.resize(250, 250).write(fileRef.path+fileRef.extension, updateAndSave);\r\n// Should be changed to:\r\nimage.resize(250, 250).write(cropName + fileRef.extension, updateAndSave);\r\n```\r\n\r\nAnd:\r\n\r\n```js\r\nvar updateAndSave = function(){\r\n    return bound(function(error){ ... });\r\n}\r\n\r\n// Should be changed to:\r\n\r\nvar updateAndSave = function(error){\r\n    bound(function(){ ... });\r\n}\r\n```"}}
{"actor":{"display_login":"dr-dimitru"}}