"thread '<unnamed>' panicked" when transforming invalid SVG
See original GitHub issueFor a particular SVG image which is invalid according to The W3 markup validator, I get the following error:
thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', libcore/option.rs:345:21
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Aborted (core dumped)
While I’m not expecting that sharp can successfully transform invalid input, it would be nice if the error would be properly handled.
To reproduce:
const fs = require('fs');
const sharp = require('sharp');
const IMG_PATH = 'invalid.svg';
const transformer = sharp();
const imageStream = fs.createReadStream(IMG_PATH);
imageStream.pipe(transformer);
try {
transformer.toBuffer(function(err, buffer, info){
console.log("success");
})
} catch (e) {
console.log("Threw handlable error")
}
Link to invalid.svg and a valid SVG which does work (can’t add SVGs to github comments).
I’m using sharp version 0.21.3
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Reading SVG fails with Cairo "out of memory" error (w ... - GitLab
Hey, I'm getting a crash in rsvg-convert and tools which use librsvg ... rsvg-convert repro.svg thread '<unnamed>' panicked at 'Cairo error ...
Read more >Jest cannot load svg file - Stack Overflow
svg files from an icon library in node_modules 1. Using jest-transform-stub in the "transform" section of jest.config.js did not work for me, ...
Read more >Bug listing with status RESOLVED with resolution OBSOLETE ...
Bug:1523 - "[IDEA] Offload work by distributing trivial ebuild maintenance to users, introduce a simple stability voting system and have a core team...
Read more >Platform/Layout/ReleaseNotes/62 - MozillaWiki
bug 1449243 thread '<unnamed>' panicked at 'assertion failed: ... Layout. bug 1165185 Invalidating transformed elements during scrolling.
Read more >User Manual - rust-analyzer
break-outside-of-loop; inactive-code; incorrect-ident-case; invalid-derive- ... The next thing to check would be panic messages in rust-analyzer's log.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes that does work. Looking forward to the release, thank you!
sharp v0.22.0 now available, providing libvips v8.7.4 and librsvg v2.45.5.