pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/graphics/py-svglib
Module Name: pkgsrc
Committed By: adam
Date: Mon Nov 30 13:42:52 UTC 2026
Modified Files:
pkgsrc/graphics/py-svglib: Makefile distinfo
Log Message:
py-svglib: updated to 2.5.0
2.5.0 (2026-11-27)
Security
- A long `transform` attribute could make `convertTransform()` take time
quadratic in its length: each pair of brackets rebuilt the whole string, and the
result was checked only afterwards, so 2 MB of brackets, which a 3 KB `.svgz`
file holds, kept `svg2rlg()` busy for minutes (CWE-407, GHSA-43qg-v5jj-vw5c). It
is read in one pass now, with the same result. Thanks to @lanjianchun for the
report.
- An `<image>` that refers to a fragment of the document, with `href="#id"`, was
rendered again without the checks that `<use>` has had since 2.3.1: a cycle, such
as an `<svg>` that contains an `<image>` that refers to it, ended in
`RecursionError`, and a few `<image>` elements that refer to each other, each
level to the one before it twice, took time that doubled with every level, so
that 2 KB took hours (CWE-400, CWE-674, GHSA-cmj4-5g24-pp37, reported again as
GHSA-4fr5-v6hm-mwjg). A cycle is now skipped and an error is logged, and all
`<image>` targets count against the same budgets as `<use>`
(`MAX_USE_EXPANSIONS`, `MAX_USE_CLONED_ELEMENTS`). An `<image>` that refers to an
element that is not defined yet is skipped too, and not an `AttributeError`.
Thanks to @GeniusKangaroo and @john-lawniczak for the reports.
- An image embedded as a `data:image/png` or `data:image/jpeg` URI was opened by
Pillow with the decoder chosen from its bytes, not from its label, so a
PostScript file made it run Ghostscript, where that is installed, when the PDF
was drawn (CWE-20, CWE-94, GHSA-h5r7-mh88-vjm4). Such an image is now decoded as
a PNG or a JPEG only (`DATA_URI_IMAGE_FORMATS`), and anything else is refused
with the `UnidentifiedImageError` that data that is not an image already got.
Thanks to @superbot-helper for the report.
Tooling and housekeeping
- CI runs PyPy 3.11 on Ubuntu 24.04 instead of `ubuntu-latest`, which is Ubuntu
26.04 now: the PyPy wheel of lxml needs `libxml2.so.2`, and 26.04 doesn't have
it, so the PyPy job failed at import time. The other jobs follow
`ubuntu-latest`.
Fixed
- A gradient with `spreadMethod="reflect"` or `"repeat"` is now repeated past
its ends, as in browsers; it was painted black there. Every other period is
back to front for `reflect`. An unknown `spreadMethod` is `pad`, and so is a
gradient that would need more than 200 periods, or more than 10,000 stops in
all of them
- The `stop-color` and `stop-opacity` of a gradient stop can now be set by a
CSS rule, such as the classes of the SVG that Illustrator exports
(`.cls-1 { stop-color: #fff }`); the stop was black. A `<style>` element
now applies to the whole document, including the elements before it, as in
browsers, and not only to the gradients in its `<defs>`: a shape that comes
before a `<style>` that styles it is no longer black
- `stop-color` set to `currentColor` in a gradient stop no longer makes
`svg2rlg()` fail with `AttributeError`; it is the `color` of the stop, as in
browsers, or black when none is set
- `hwb()` colors of CSS Color 4 are now converted to sRGB, as `oklch()` and
`oklab()` are: they were not read and the shape was not drawn
- `stop-color` and `stop-opacity` of a gradient stop can now use `var()`, such as
the `stop-color="var(--fill-0, #171D25)"` that Figma writes: the stop was
black, and the gradient with it. A `var()` without a value is as if the
property was not set.
- A gradient that refers to another one with `href` now takes the geometry,
`gradientUnits` and `spreadMethod` of that gradient when it does not set them
itself, as in browsers: it used its own defaults (`x2="1"`, `pad`,
`objectBoundingBox`) and so a gradient set on the first one was lost
- The `offset` of a gradient stop is now limited to 0 to 1 and to at least the
offset of the stop before it, as in browsers: a stop beyond the ends, such as
`offset="150%"`, or before the previous one drew a different gradient
- CSS font-size keywords such as `large`, `x-small`, `larger` and `smaller`,
in the `font-size` attribute, in `style` attributes and in the `font`
shorthand, no longer make `svg2rlg()` fail with `ValueError`. Absolute
keywords use the CSS Fonts values for a 16px `medium`, and `larger` and
`smaller` scale by 1.2
- Relative font sizes such as `70%`, `2em` and `larger` are now resolved
against the font size of the parent element, as in CSS, instead of the
default size, so `<tspan font-size="70%">` inside `<g font-size="20">` gets
14 and not 70
- Color keywords and function names are now read regardless of case, as in
CSS: `fill="White"`, `stroke="RED"`, `RGB(255, 0, 0)` and `currentcolor` no
longer leave the shape without a fill or stroke
- The CSS named colors `rebeccapurple` and `lightgray`, which ReportLab lacks,
are now read, and `darkseagreen` is `#8fbc8f` as in CSS, not ReportLab's
`#8fbc8b`
- The content of a nested `<svg>` with a `viewBox` is now drawn at the size
given by its `width` and `height`; it was drawn at 75% of that before,
because the px-to-pt factor of the drawing was applied a second time to the
nested viewport
- A `clip-path` given in a `style` attribute or a CSS rule, or as a quoted or
spaced `url()` such as `url("#clip")`, now clips the element; only the
`clip-path="url(#clip)"` attribute did before. Illustrator's CSS exports and
svgo-optimized matplotlib charts set it in CSS
- The hue of `hsl()` and `hsla()` may now have a CSS angle unit: `deg`, `grad`,
`rad` or `turn`. `fill="hsl(120deg, 100%, 50%)"` was drawn black instead of
green
- A `light-dark()` color, which draw.io writes in its SVG exports, is now read
as its first, light color, the one CSS uses when no `color-scheme` is set;
the shape lost its fill or stroke before
- `var()` is now read, in `fill`, `stroke` and other values, as Figma and VS
Code write colors that a theme can change, such as
`fill="var(--fill-0, #171D25)"`: it is the custom property of the element or
an ancestor, set in a `style` attribute or a CSS rule, or else its fallback.
Such a value was not read and the shape was not drawn. A value that needs
more than 1000 replacements, or becomes longer than 100,000 characters, is
invalid, so a small SVG cannot make it take exponential time
- An `<image>` that references an SVG document now draws it in the viewport
given by its `width` and `height`, with its own `preserveAspectRatio`, as
browsers and Inkscape do; the document was drawn at its own size, ignoring
the size of the `<image>`
- `fill` and `stroke` set to `currentColor` in another case, such as
`currentcolor`, or with `!important`, now use the `color` property; they were
drawn black
- `width="auto"` and `height="auto"` on an `<svg>`, as Figma writes them, for
instance in the country flags of the ProtonVPN apps, are now read like a
missing `width` and `height`, also on a root `<svg>` without a `viewBox`;
`svg2rlg()` failed with `ValueError: Can't convert 'auto' to length`
- `em` and `ex` lengths in the geometry of shapes, such as `width="2em"` or
`r="1em"`, and in the `width` and `height` of the root `<svg>`, now use the
font size of the element, as in CSS; they always used 16px before
- `oklch()` and `oklab()` colors of CSS Color 4, as in the social preview
images of react-window, are now converted to sRGB: they were not read and
the shape was not drawn
- The `x` and `y` of a `<use>`, and of an `<image>` that references SVG
content, are now read as lengths: with a unit, such as `x="20px"` or
`y="1in"`, or as a percentage, the content was drawn at the origin before
- A `<clipPath>` without any shape now clips its elements away, as in browsers,
instead of leaving them without a clip: `clip-path="url(#clip)"` of an empty
`<clipPath>` drew the whole element
- A gradient with no extent, that is a linear gradient with both ends in the same
place or a radial gradient with a radius of 0, now paints the shape in the
color of its last stop, as in browsers; it was black or the first color
- The `gradientTransform` of a linear or radial gradient is now applied, with
`translate`, `scale`, `rotate`, `skewX`, `skewY` and `matrix`, in the units of
the bounding box and in the user space, and it is taken from the gradient it
refers to by `href`; it was ignored, so a gradient rotated by Figma or Illustrator
ran in the wrong direction. A radial gradient scaled by it is an ellipse. With
`spreadMethod` `reflect` or `repeat`, the periods that cover the shape are counted
in the space of the gradient, and a transform that cannot be inverted, such as
`scale(0)`, paints nothing, as in browsers
- A percentage in the coordinates or radius of a gradient with
`gradientUnits="userSpaceOnUse"`, such as `x2="50%"` or `r="25%"`, is now a
percentage of the viewport, as in browsers: of the width for `x1`, `x2`, `cx` and
`fx`, of the height for `y1`, `y2`, `cy` and `fy`, and of the normalized diagonal
for `r`. It was read as a fraction, so `x2="50%"` was half a user unit long
- The `preserveAspectRatio` of a nested `<svg>` now aligns the viewBox to the top
for `yMin` and to the bottom for `yMax`, as in browsers; they were the other way
round
- A radial gradient in the units of the bounding box on a shape that is not square
is now an ellipse, and a slanted linear one is skewed, as in browsers, because the
gradient is stretched with the bounding box; they were drawn as a circle, and with
the lines of equal color perpendicular to the axis
To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 pkgsrc/graphics/py-svglib/Makefile
cvs rdiff -u -r1.6 -r1.7 pkgsrc/graphics/py-svglib/distinfo
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/graphics/py-svglib/Makefile
diff -u pkgsrc/graphics/py-svglib/Makefile:1.8 pkgsrc/graphics/py-svglib/Makefile:1.9
--- pkgsrc/graphics/py-svglib/Makefile:1.8 Tue Nov 10 09:50:43 2026
+++ pkgsrc/graphics/py-svglib/Makefile Mon Nov 30 13:42:52 2026
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.8 2026/11/10 09:50:43 adam Exp $
+# $NetBSD: Makefile,v 1.9 2026/11/30 13:42:52 adam Exp $
-DISTNAME= svglib-2.4.0
+DISTNAME= svglib-2.5.0
PKGNAME= ${PYPKGPREFIX}-${DISTNAME}
CATEGORIES= graphics python
MASTER_SITES= ${MASTER_SITE_PYPI:=s/svglib/}
Index: pkgsrc/graphics/py-svglib/distinfo
diff -u pkgsrc/graphics/py-svglib/distinfo:1.6 pkgsrc/graphics/py-svglib/distinfo:1.7
--- pkgsrc/graphics/py-svglib/distinfo:1.6 Tue Nov 10 09:50:43 2026
+++ pkgsrc/graphics/py-svglib/distinfo Mon Nov 30 13:42:52 2026
@@ -1,5 +1,5 @@
-$NetBSD: distinfo,v 1.6 2026/11/10 09:50:43 adam Exp $
+$NetBSD: distinfo,v 1.7 2026/11/30 13:42:52 adam Exp $
-BLAKE2s (svglib-2.4.0.tar.gz) = 583472881c15f69e3495589f7087a061f7007ec97c3a2fe5cdb4648dc623cb3b
-SHA512 (svglib-2.4.0.tar.gz) = 195953a568492c6719a0ce2a60b04cbb2e5fb8609ae8a3dc513e16abfef682e8c1cd68d339c46df40ba01cff7816799e058871b112c57a94f33bdf54f71e5378
-Size (svglib-2.4.0.tar.gz) = 1393162 bytes
+BLAKE2s (svglib-2.5.0.tar.gz) = c109e14840b46d83a715ebf9d9e9ff0e180d53b9a2cf2380baf1d90f930518de
+SHA512 (svglib-2.5.0.tar.gz) = e935596592f4327a9e550ed76b942f645a104cf26aa86484b27767d4804fb405fb3b47b33221873821d343283ab788e3797550c6964a91b85cc6ce8344dcde06
+Size (svglib-2.5.0.tar.gz) = 1416450 bytes
Home |
Main Index |
Thread Index |
Old Index