[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#64908: 29.1; svg parse failure
From: |
Alan Third |
Subject: |
bug#64908: 29.1; svg parse failure |
Date: |
Sat, 5 Aug 2023 11:24:19 +0100 |
On Sat, Aug 05, 2023 at 01:07:38PM +0300, Eli Zaretskii wrote:
> > Date: Sat, 5 Aug 2023 10:58:26 +0100
> > From: Alan Third <alan@idiocy.org>
> > Cc: Eli Zaretskii <eliz@gnu.org>, 64908@debbugs.gnu.org
> >
> > diff --git a/src/image.c b/src/image.c
> > index c9420b48f4a..96e0f2a7225 100644
> > --- a/src/image.c
> > +++ b/src/image.c
> > @@ -11161,6 +11161,21 @@ svg_css_length_to_pixels (RsvgLength length,
> > double dpi, int font_size)
> > case RSVG_UNIT_IN:
> > value *= dpi;
> > break;
> > + case RSVG_UNIT_PERCENT:
> > + /* Percent is a ratio of the containing "viewport". We don't
> > + have a viewport, as such, as we try to draw the image to it's
> > + own desired size rather than dictate the size as if we were
> > + drawing icons on a toolbar or similar. This means that
> > + percent values are useless to us and we are best off just
> > + drawing the image according to whatever other sizes we can
> > + derive.
> > +
> > + If we do set explicit width and height values in the image
> > + spec, this will work out correctly as librsvg will still
> > + honour the percentage sizes in its final rendering no matter
> > + what size we make the image. */
> > + value = 0;
> > + break;
>
> I don't see RSVG_UNIT_PERCENT anywhere in the librsvg headers on my
> system, so perhaps this was introduced by some later version, and
> should be guarded by LIBRSVG_CHECK_VERSION?
Hmm, I can't find any reference to when it was introduced, so it's
probably easier just to remove it and put the comment in the default
case.
(Interestingly while searching for the version I discovered this code
has been used, almost verbatim, in libvips. The main difference is
they're defining "ex" as half of "em", so perhaps we should copy that
change back over...)
--
Alan Third
v2-0001-Fix-percentage-sizes-in-SVG-display-bug-64908.patch
Description: Text Data
- bug#64908: 29.1; svg parse failure, (continued)
- bug#64908: 29.1; svg parse failure, Eli Zaretskii, 2023/08/04
- bug#64908: 29.1; svg parse failure, David Ponce, 2023/08/04
- bug#64908: 29.1; svg parse failure, Eli Zaretskii, 2023/08/04
- bug#64908: 29.1; svg parse failure, David Ponce, 2023/08/04
- bug#64908: 29.1; svg parse failure, Alan Third, 2023/08/04
- bug#64908: 29.1; svg parse failure, Eli Zaretskii, 2023/08/04
- bug#64908: 29.1; svg parse failure, David Ponce, 2023/08/04
- bug#64908: 29.1; svg parse failure, David Ponce, 2023/08/05
- bug#64908: 29.1; svg parse failure, Alan Third, 2023/08/05
- bug#64908: 29.1; svg parse failure, Eli Zaretskii, 2023/08/05
- bug#64908: 29.1; svg parse failure,
Alan Third <=
- bug#64908: 29.1; svg parse failure, Eli Zaretskii, 2023/08/05
- bug#64908: 29.1; svg parse failure, David Ponce, 2023/08/05
- bug#64908: 29.1; svg parse failure, Alan Third, 2023/08/05
- bug#64908: 29.1; svg parse failure, David Ponce, 2023/08/05
- bug#64908: 29.1; svg parse failure, Alan Third, 2023/08/05
- bug#64908: 29.1; svg parse failure, David Ponce, 2023/08/05
- bug#64908: 29.1; svg parse failure, Alan Third, 2023/08/05
- bug#64908: 29.1; svg parse failure, David Ponce, 2023/08/05
- bug#64908: 29.1; svg parse failure, Alan Third, 2023/08/05
- bug#64908: 29.1; svg parse failure, David Ponce, 2023/08/05