scionoftech / webp-converter

[DEPRECATED] A small node.js library for converting any image to webp file format or converting webp image to any image file format.
MIT License
232 stars 44 forks source link

Convertion error from gif to webp #2

Closed lordmelique closed 8 years ago

lordmelique commented 8 years ago

EDIT: Alright I've added that functionality to this module please merge project with my fork

Hi, I've tried to convert .gif image to web webp but I get this error, and I don't know what to do, may you help me to figure this out? Here is my code and error. I'm using Ubuntu 16.04

webp.dwebp(req.files.gif.path, req.files.gif.path.replace(/.gif/,"")+'.webp', function (status) { //if conversion successfull status will be 'converted successfully' console.log(req.files.gif.path+'.webp'); console.log(status); });

{ [Error: Command failed: /home/melontron/Projects/dhol/node_modules/webp-converter/lib/libwebp_linux/bin/dwebp /tmp/vNhNhgJ_hJjGczZ5BIUQSPKf.gif -o /tmp/vNhNhgJ_hJjGczZ5BIUQSPKf.webp Decoding of /tmp/vNhNhgJ_hJjGczZ5BIUQSPKf.gif failed. Status: 3(BITSTREAM_ERROR) ] killed: false, code: 255, signal: null, cmd: '/home/melontron/Projects/dhol/node_modules/webp-converter/lib/libwebp_linux/bin/dwebp /tmp/vNhNhgJ_hJjGczZ5BIUQSPKf.gif -o /tmp/vNhNhgJ_hJjGczZ5BIUQSPKf.webp' }

I've also tried with cwebp webp.cwebp(req.files.gif.path, req.files.gif.path.replace(/.gif/,"")+'.webp','100', function (status) { //if conversion successfull status will be 'converted successfully' console.log(req.files.gif.path+'.webp'); console.log(status); });

{ [Error: Command failed: /home/melontron/Projects/dhol/node_modules/webp-converter/lib/libwebp_linux/bin/cwebp -q 100 /tmp/WeQrD2mjGrG0lG--yzum4WX9.gif -o /tmp/WeQrD2mjGrG0lG--yzum4WX9.webp Error! Could not process file /tmp/WeQrD2mjGrG0lG--yzum4WX9.gif Error! Cannot read input picture file '/tmp/WeQrD2mjGrG0lG--yzum4WX9.gif' ] killed: false, code: 255, signal: null, cmd: '/home/melontron/Projects/dhol/node_modules/webp-converter/lib/libwebp_linux/bin/cwebp -q 100 /tmp/WeQrD2mjGrG0lG--yzum4WX9.gif -o /tmp/WeQrD2mjGrG0lG--yzum4WX9.webp' }

scionoftech commented 8 years ago

Hi Melik,i have solved the issue by adding gif2webp.

Please check out the usage in the webp-converter npm package .

https://www.npmjs.com/package/webp-converter

Thank you.

On Tue, Jul 19, 2016 at 5:34 PM, Melik notifications@github.com wrote:

Hi, I've tried to convert .gif image to web webp but I get this error, and I don't know what to do, may you help me to figure this out? Here is my code and error

webp.dwebp(req.files.gif.path, req.files.gif.path.replace(/.gif/,"")+'.webp', function (status) { //if conversion successfull status will be 'converted successfully' console.log(req.files.gif.path+'.webp'); console.log(status); });

{ [Error: Command failed: /home/melontron/Projects/dhol/node_modules/webp-converter/lib/libwebp_linux/bin/dwebp /tmp/vNhNhgJ_hJjGczZ5BIUQSPKf.gif -o /tmp/vNhNhgJ_hJjGczZ5BIUQSPKf.webp Decoding of /tmp/vNhNhgJ_hJjGczZ5BIUQSPKf.gif failed. Status: 3(BITSTREAM_ERROR) ] killed: false, code: 255, signal: null, cmd: '/home/melontron/Projects/dhol/node_modules/webp-converter/lib/libwebp_linux/bin/dwebp /tmp/vNhNhgJ_hJjGczZ5BIUQSPKf.gif -o /tmp/vNhNhgJ_hJjGczZ5BIUQSPKf.webp' }

I've also tried with cwebp webp.cwebp(req.files.gif.path, req.files.gif.path.replace(/.gif/,"")+'.webp','100', function (status) { //if conversion successfull status will be 'converted successfully' console.log(req.files.gif.path+'.webp'); console.log(status); });

{ [Error: Command failed: /home/melontron/Projects/dhol/node_modules/webp-converter/lib/libwebp_linux/bin/cwebp -q 100 /tmp/WeQrD2mjGrG0lG--yzum4WX9.gif -o /tmp/WeQrD2mjGrG0lG--yzum4WX9.webp Error! Could not process file /tmp/WeQrD2mjGrG0lG--yzum4WX9.gif Error! Cannot read input picture file '/tmp/WeQrD2mjGrG0lG--yzum4WX9.gif' ] killed: false, code: 255, signal: null, cmd: '/home/melontron/Projects/dhol/node_modules/webp-converter/lib/libwebp_linux/bin/cwebp -q 100 /tmp/WeQrD2mjGrG0lG--yzum4WX9.gif -o /tmp/WeQrD2mjGrG0lG--yzum4WX9.webp' }

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/scionoftech/webp-converter/issues/2, or mute the thread https://github.com/notifications/unsubscribe-auth/AMRkghJtAOI0KGMdAEwrM_hNcX9giR74ks5qXL1KgaJpZM4JPp-8 .