mapcairo.c: avoid double scaling of SVG symbols (fixes: #7430) - #7583
Conversation
Since 8.6, rsvg_handle_render_cairo() (marked as depriceated) was replaced with the newer rsvg_handle_render_document(), however this caused scaling issues (MapServer#7430). This PR implements a simple workaround by reverting back to the legacy function, solving the issues.
|
This fails two CI checks, because the use of the deprecated function
|
|
@johanez there are actually 2 different failing errors in your tests (click on each of the 2 runs, and you will see what I mean). For example: https://github.com/MapServer/MapServer/actions/runs/29905134730/job/88913132480?pr=7583 |
|
@jmckenna I found another possible solution, using the non-deprecated |
|
@johanez please also update the title of this pull request, thanks. |
|
I updated the test files. As svg rendering was not working correctly, the coordinates used in the test point-identify with anchor test were not correct. |
… version This allows cairo and older rsvgr rendering with scale_cairo> Also fixed incorrect test png file name
|
Update from my side: I used the solution suggested by @bhark, as it more easily allows to be compatibel with older librsvg versions (<2.43) as well. Some test still fail, I think mostly because the However, it's quite a task for me to go through this (skill and capacity wise, I have a very un-efficient test setup now), so if anyone want to have a look, more than welcome! |
|
@johanez thanks. At this point, the issue isn't fixing the tests in this pull request, the issue is that people in #7430 have confirmed a different fix, than this one. I really want everyone to agree on one fix...I'll give this a few days more to await everyone's feedback here. Thanks for pushing this forward @johanez very appreciated! |
|
@jmckenna The fix implemented here is the same as i suggested in #7430, and seems functional to me. #7462 just adds the guard, which is already in this PR. With regards to the failing tests @johanez the original commit that introduced this issue also regenerated the reference pictures, so they're currently checking the correct rendering against a faulty baseline. I think we just need to regenerate the references (all 6) and call it a day. I'll open a PR on @johanez fork if i get the time later today. |

Since 8.6,
rsvg_handle_render_cairo()(marked as deprecated) was replaced with the newerrsvg_handle_render_document(), however this caused scaling issues (#7430).This PR implements a simple workaround by reverting back to the legacy function, solving the issues.This PR removes a duplicate application of scale when rendering svgs to raster with
librsvg.What does this PR do?
Path symbol size directly to
rsvg_handle_render_document()without scaling as the scaling is already passed with the viewport parameter, while mainting options to use the deprecatedrsvg_handle_render_cairo()vorlibrvgversions before v2.46.What are related issues/pull requests?
librsvgversions withrsvg_handle_render_cairo().AI tool usage
AI supported my development of this PR. See our policy about AI tool use. Use of AI tools, if any, must be indicated.Tasklist
/msautotest(follow steps in Regression Testing)