svg2pdf incorrect width and height output -
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Reproduce the issue with the provided SVG dimensions and the svg2pdf call, then inspect svg2pdf's dpi handling and the UNITS['pt'] conversion mentioned in the report. Compare the generated PDF dimensions with the source dimensions and determine the expected unit behavior; done when the behavior is corrected or clearly documented with a regression check.
Written by the indexing model from the issue text.
Description
I have an svg file with attributes
width="1929" height="2572"
which I created as a bytestring or as a file
cairosvg.svg2pdf(svgstr, write_to="svg_0.pdf")
svg_0.pdf comes out with 'width': 1446.75, 'height': 1929
I looked thru the code and I noticed that the svg2pdf(dpi=96) default, cairosvg UNITS['pt'] will scale to 72dpi.
If my svg has no mention of dpi, or units, why should it be assumed that one wishes to scale ?
fix to the unit assumption is to just pass dpi=72
- Dominant language
- Python
- Stars
- 959
- Forks
- 172
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
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.
More from Kozea/CairoSVG
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
并发下的渲染表现Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Exception "The SVG size is undefined" raised using svg2pngPossibly taken @DSeaStar claimed this 111 days ago. Openbug
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
feature
Difficulty 4/5 3-5 days Newbie friendliness 30/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Techiebutler/freeframe#687 ·
Maintainers usually reply within 1 day
-
bug verbose GC
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
IBM/javacore-analyser#677 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 2 days
-
area/config comp/plugins P1 platform/qqbot tool/file type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
NousResearch/hermes-agent#163932 · 1 comment ·
Maintainers usually reply within 1 day
-
plugins/dsh: todayStr() computes UTC but is documented as local — journal entries written 00:00–08:00 local land in the previous day's filePossibly taken @Beehtrix claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
zilliztech/memsearch#907 · 1 comment ·
Maintainers usually reply within 1 day