1
实:graphicsmagick transformWrite错误写EOF请与此错误帮助,使用CFS:实:graphicsmagick为Fs.Store.GridFS,我有这样的代码..流星CFS:在errnoException
Avatar = new FS.Collection("avatar", {
stores: [new FS.Store.GridFS("avatar", {
transformWrite: function (fileObj, readStream, writeStream) {
gm(readStream, fileObj.name()).resize(50, 50).stream().pipe(writeStream);
}
})],
filter: {
maxSize: 3145728, // in bytes
allow: {
contentTypes: ['image/*'],
extensions: ['png', 'jpg']
},
onInvalid: function (message) {
Bert.alert('Error', 'danger', 'growl-top-right');
}
},
beforeWrite: function (fileObj) {
return {
extension: 'png',
type: 'image/png'
};
}
});
Avatar.allow({
insert: function() {
return true;
},
update: function() {
return true;
},
remove: function() {
return true;
},
download: function (userId, doc) {
return true;
}
});
但这产生这个错误.. enter image description here
在某些情况下它不会产生上述尺寸的错误,但是当储蓄让我从零(0)字节,使用transformWrite的时候,如果我错过正常工作,但与原来的dimencion,而不是导致该错误操作,但图像必须有50x50 ..
感谢您的帮助..
您正在使用哪个版本的Meteor? CollectionFS已弃用。 https://forums.meteor.com/t/deprecating-collectionfs/16921 – vijayst
版本[email protected],或者替代方案将不得不上传图片到服务器? .. –