Closed misos1 closed 3 years ago
Please, provide details how to reproduce.
Yes, I am trying to produce some minimal test case but maybe I hoped that there is something obvious. Till now seems it does not happen for example with heic.
It's not obvious, sorry. Example needed.
@puzrin I updated it with example. Sorry for those additional dependencies (they may make the right timing or so).
Maybe the problem is that it will not change state to STATE_IGNORE
right after it gets results? https://github.com/nodeca/probe-image-size/blob/master/lib/parse_stream/svg.js#L157-L175
Looking at it and realising that writing null to object stream ends it - it is actually pretty obvious and posted callstack directly blames line 163.
Simplified test case:
let { PassThrough } = require("stream");
let probe = require("probe-image-size");
let stm = new PassThrough();
probe(stm);
stm.write(`<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100pt" height="100pt" viewBox="0 0 100 100" version="1.1">`);
stm.write(" ");
Test case (test.js):
Install and run (it may take some time):
Possible output: