1

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..

1 Answers1

0

The problem was my operating system I was using Windows 10, I switched to Ubuntu 16.04 operating system and works perfectly .. 07 Sep 2016 .. sorry my English ..