Please help with this error, use cfs:graphicsmagick for Fs.Store.GridFS, I have this code..
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;
}
});
But this generates this error .. enter image description here
On some occasions it does not generate the above-dimensioned mistake but when saving keeps me from zero (0) bytes, this error results when using transformWrite, if I miss working properly but with the original dimencion and not manipulated, but the images must have 50x50 ..
Thanks for your help..