Kozea / Kozea/CairoSVG

svg with improperly positioned tiled images

Open
#400 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
951
Forks
166
PR merge metrics
No merged PRs in 30d

Description

Hi, I have an .svg file (`the_svg_file`) which contains 2 images (I tried both embedded data uri using base64 string and an external website url). When previewed, the images work fine:

Screenshot 2023-09-02 at 12 57 46 PM

Using cairosvg to convert this svg file to a png however results in the images appearing but not where they're supposed to be:

Screenshot 2023-09-02 at 1 02 32 PM

I'm using the following code to invoke cairosvg, to wit:

```py
>>> import cairosvg
>>> cairosvg.svg2png(
bytestring=the_svg_file.read_bytes(),
write_to=output_file.as_posix(),
unsafe=True
)
```

Wondering if I'm missing anything in the command to ensure that I get parity between the raw svg and the target output file, post-conversion.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the reported SVG containing two tiled images and reproduce the result through the shown cairosvg.svg2png call, testing both embedded data URIs and external URLs. Compare the converted PNG's image positions with the SVG preview; done means both images are rendered at their intended locations.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
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.