我有在流星 CFS 中调整大小的方法,比如页面。
var createThumb = function(fileObj, readStream, writeStream) {
// Transform the image into a 10x10px thumbnai
gm(readStream, fileObj.name()).size({ bufferStream: true }, function(err, size){
if (err) {
console.log('error parece:');
console.log(err);
}
console.log(size);
if((size.width * 1.3) > size.height){
fileObj.ancho= "ancho";
this.resize('600').stream().pipe(writeStream);
}else if((size.height * 1.3) > size.width) {
fileObj.ancho= "alto";
this.resize(null, '600').stream().pipe(writeStream);
}else{
fileObj.ancho= "cuadrado"; ;
this.resize(300).stream().pipe(writeStream);
}
});
};
如何将元数据文件Obj.ancho 保存在集合中?