linebender / linebender/resvg

Bounding box inconsistencies - different values between 0.28 and 0.44

Open
#831 3 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

I have noticed some wierd things about measurements returned `resvg --query-all`. The units are not obvious, and measurements have changed from v0.42 onwards.

Let's sayy we call `resvg --query-all` on the following SVG file using versions v0.34 to v0.44:

```svg

```

We get the following (I used an Elixir project to download the 10 versiona and set things up, the important part are the measurements returned by each version):

```text
2) test query dimensions (ResvgTestMinimal)
test/resvg_test_minimal_test.exs:92
** (RuntimeError) A number of outputs was returned by the different resvg versions.
The versions grouped by output are the following:

===== v0.42.0, v0.43.0, v0.44.0 ========

rect-1,260.417,260.417,17.361,17.361

===== v0.34.0, v0.35.0, v0.36.0, v0.37.0, v0.38.0, v0.39.0, v0.40.0, v0.41.0 ========

rect-1,62.5,62.5,4.167,4.167
```

I can't find these differences documented anywhere. Is any of these the expected value? Which units should these numbers be? What changes in v0.42? I actualy found about this when using resvg to get some text measurements, where there seems to be further "weirdness", but even the 1pt-side rectangle has left me a bit stumped...

Thanks for any help.

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

Start with the `resvg --query-all` entry point and `test/resvg_test_minimal_test.exs` around line 92, comparing versions v0.34 through v0.44. Establish which units and values are expected, then document or test the v0.42 behavior so the version difference is explained and the measurements are consistently verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.