SVG polygon clip path not respected on text node
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 32.7k
- Forks
- 1.4k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 5
Description
Are you using the latest version? Is the version currently in use as reported by npm ls sharp the same as the latest version as reported by npm view sharp dist-tags.latest?
Yes, sharp@0.27.1
What are the steps to reproduce?
const { data: svg } = await axios({
url: "https://etg.dek.im/deck/08mqs066uq066ui067ar047ne018pj.svg",
responseType: "arraybuffer",
});
const png = await sharp(svg).png().toBuffer();
What is the expected behaviour?
Are you able to provide a minimal, standalone code sample, without other dependencies, that demonstrates this problem?
See above.
Are you able to provide a sample image that helps explain the problem?

What is the output of running npx envinfo --binaries --system?
System:
OS: macOS 10.15.7
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 1.26 GB / 16.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.18.3 - ~/.n/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 6.14.9 - ~/.n/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the provided axios and sharp example against the linked SVG, using the reported sharp@0.27.1 environment, and compare the PNG with the expected image. Trace SVG-to-PNG handling for polygon clip paths applied to text nodes. Done means the rendered text respects the polygon clip path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100