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],或者替代方案將不得不上傳圖片到服務器? .. –