nodeca / probe-image-size

Get image size without full download. Supported image types: JPG, GIF, PNG, WebP, BMP, TIFF, SVG, PSD, ICO.
MIT License
978 stars 77 forks source link

svg: fix "push after EOF" error #53

Closed misos1 closed 3 years ago

misos1 commented 3 years ago

Fixes #52.

Also adds test case which fails without this patch:

  1) probeStream
       should not fail when processing svg in multiple chunks:
     Uncaught Error [ERR_STREAM_PUSH_AFTER_EOF]: stream.push() after EOF
  2) probeStream
       should not fail when processing svg in multiple chunks:
     Error: done() called multiple times in test <probeStream should not fail when processing svg in multiple chunks> of file probe-image-size/test/test_stream.js