Conversation
Codecov Report
@@ Coverage Diff @@
## master #196 +/- ##
==========================================
- Coverage 60.78% 60.21% -0.58%
==========================================
Files 40 40
Lines 2637 2662 +25
==========================================
Hits 1603 1603
- Misses 1034 1059 +25
Continue to review full report at Codecov.
|
|
Hey @JosephLing! Thanks for taking the time to implement this feature. Unfortunately, the The implementation we will eventually strive for is probably something closer to what we have for I'm going to close this PR for now because I'm not going to have the bandwidth to get it to the implementation we eventually want. I appreciate your eagerness and the effort it took to put this together! 😄 |
Using the
nsvglibrary which is based offnanosvgto save the export svg string as a png. So that the output forsave_svgandsave_pngare exactly the same.One small change is that
fill-opacityandstroke-opacityare used for the alpha value instead ofrgba. This is because despite using theimage::ColorType::Rgba8the alpha channel is not converted properly when saving the image. I suspect this because the actualnsvglibrary doesn't supportrgba()colours as I got exactly the same error when testing theresvglibrary of a black image. Theresvgconverts the svg input into a svg just made up ofpathsallowing you to see the intermediate representation. That showedstroke="none"thereforergbacolour was the issue I think and that changing it fixed it.