GNU bug report logs - #44655
28.0.50; Oversized SVG margin

Previous Next

Package: emacs;

Reported by: "Matsievskiy S.V." <matsievskiysv <at> gmail.com>

Date: Sun, 15 Nov 2020 11:17:01 UTC

Severity: normal

Found in version 28.0.50

Done: Alan Third <alan <at> idiocy.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Alan Third <alan <at> idiocy.org>
Cc: 44655 <at> debbugs.gnu.org
Subject: bug#44655: 28.0.50; Oversized SVG margin
Date: Fri, 3 Dec 2021 10:45:55 -0800
[Message part 1 (text/plain, inline)]
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 (text/x-patch, attachment)]
[0002-Simplify-svg_load_image.patch (text/x-patch, attachment)]
[0003-Improve-overflow-checking-in-svg_load_image.patch (text/x-patch, attachment)]
[0004-Prefer-rsvg_handle_get_intrinsic_size_in_pixels.patch (text/x-patch, attachment)]

This bug report was last modified 3 years and 171 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.