|
From: | Paul Eggert |
Subject: | bug#44655: 28.0.50; Oversized SVG margin |
Date: | Fri, 3 Dec 2021 10:45:55 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.1 |
On 11/6/21 05:55, Alan Third wrote:
There seems to be a lot of churn in the librsvg API at the moment, and their documentation isn't keeping up as it still doesn't mark rsvg_handle_get_dimensions as deprecated. It appears they've introduced rsvg_handle_get_intrinsic_size_in_pixels which does the same thing (but better) than my sizing code, but anyone using librsvg 2.46-2.52, which is probably most people for now, can't use it and probably don't want to use the old scheme, so I expect there's no point replacing my code at the moment.
If it improves on your code then let's try using it for bleeding-edge librsvg (2.52.0+).
Perhaps what we should do is move the final "else" section of the previous code block (where rsvg_handle_get_geometry_for_layer is called) into its own block which is executed if (viewbox_width == 0 || viewbox_height == 0) instead of only in the case where rsvg_handle_get_intrinsic_dimensions fails to return any dimensions. That way we should have *some* dimensions without having to call rsvg_handle_get_dimensions.
I installed a patch into master to do that, along with other patches to try using svg_handle_get_intrinsic_size_in_pixels with bleeding-edge librsvg, and to catch some potential integer overflow problems I noticed while doing all this (see attached).
0001-More-robust-svg_load_image-fallback.patch
Description: Text Data
0002-Simplify-svg_load_image.patch
Description: Text Data
0003-Improve-overflow-checking-in-svg_load_image.patch
Description: Text Data
0004-Prefer-rsvg_handle_get_intrinsic_size_in_pixels.patch
Description: Text Data
[Prev in Thread] | Current Thread | [Next in Thread] |