chuckfairy / node-webcam

Nodejs Cross Platform Webcam usage
MIT License
193 stars 51 forks source link

png file generated corrupt on Ubuntu 16.04 #22

Closed stherrienaspnet closed 6 years ago

stherrienaspnet commented 6 years ago

Hello, I would like to use your package on Ubuntu 16.04 but sadly it is just working with jpg output. Just running the same code with default options except png does not generate a valid file.

If you need more detail let me know.

chuckfairy commented 6 years ago

Can you upload the picture for me? What is the command line action that is being executed? EX fswebcam ... . Have a feeling that maybe an error or warning message is being put into the file output. Never experienced this before myself. Hopefully fswebcam didn't change something.

ujjawaljaiswal2017 commented 6 years ago

I am having a similar problem on Ubuntu 18. This is the png generated. my_picture

offwhite commented 6 years ago

I was also facing the same problem, so I enabled verbose and got this:

fswebcam -q  -r 1280x720 --png 100     --no-banner   /bot/motion/image_b.png
GD Error: gd-png: fatal libpng error: bad parameters to zlib
GD Warning: gd-png error: setjmp returns error condition

found this: https://processwire.com/talk/topic/274-resolved-png-resize-error/

The answer to which was to drop the quality to within png bounds 0..9

So I changed my params to have quality 9 and it worked.

chuckfairy commented 6 years ago

Thanks for the details were going to force it to be 9 now if it's over. https://github.com/chuckfairy/node-webcam/pull/24/files