linebender / linebender/resvg

usvg: Image.id is always empty

Open
#886 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
4.1k
Forks
348
Avg merge
1d 14h
Merged PRs (30d)
3

Description

https://github.com/linebender/resvg/blob/f4188ddf7f0f3dcb39e6e4390a4f97040e9abc91/crates/usvg/src/parser/image.rs#L242

The `id` value is already moved into the parent group `id`, so the straightforward fix incurs string cloning performance penalty.

https://github.com/linebender/resvg/blob/f4188ddf7f0f3dcb39e6e4390a4f97040e9abc91/crates/usvg/src/parser/image.rs#L240

Does it make sense to remove the field to reduce confusion?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect crates/usvg/src/parser/image.rs around lines 240-242 to trace how the image id is moved into its parent group and why Image.id remains empty. Decide whether the field should be removed or preserved without an unnecessary clone, then validate that the resulting image and group identifiers behave consistently in the existing test suite.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.