嘿,
我尝试将图像合并为gif,但是我没有使用gif编码器,gif编码器,gif.js,gif镜头等来获得图像。这是我的最新尝试:
var GIFEncoder = require('gifencoder');
var encoder = new GIFEncoder(854, 480);
var pngFileStream = require('png-file-stream');
var fs = require('fs');
pngFileStream('./imgs/',/\.png$/)
.pipe(encoder.createWriteStream({ repeat: -1, delay: 500, quality: 10 }))
.pipe(fs.createWriteStream('myanimated.gif'));
,出现以下错误:
node_modules/png-js/png-node.js:157
b1 = this.data[this.pos++] << 24;
^
TypeError: Cannot read property '8' of undefined
这意味着在这种情况下,错误消息出现了 因为名为some.png的文件与 node.js脚本。 (png-js: cannot read property '8' of undefined)