Skip to content

AI turns documents or topics into real, native PowerPoint decks—with native shapes, transitions and animations, data-backed charts and tables on demand, audio narration from speaker notes, and support for your own .pptx templates. · by Hugo He

fix(svg-to-pptx): reject unmapped blur edge modes

hugohe37c40318fe17d
diff --git a/skills/ppt-master/references/shared-standards.md b/skills/ppt-master/references/shared-standards.md
index f38c7db8..d42ec23c 100644
--- a/skills/ppt-master/references/shared-standards.md
+++ b/skills/ppt-master/references/shared-standards.md
@@ -761,6 +761,7 @@ Filters are native-effect metadata, not a general pixel-filter surface.
| Required parameters | Explicit `stdDeviation` on either effect primitive; explicit `dx`, `dy`, and `flood-opacity` on `feDropShadow`; explicit `flood-opacity` on `feFlood`; explicit `slope` on linear `feFuncA` |
| Accepted helpers | `feOffset`, `feFlood`, `feComposite`, `feMerge`, `feMergeNode`, `feComponentTransfer`, linear `feFuncA` |
| Alpha transfer | Linear `feFuncA` maps multiplicative `slope` only; `intercept` is unsupported |
+| Blur sampling | `feGaussianBlur edgeMode` is unsupported; native effects do not expose the SVG edge-sampling modes |
| Numeric values | Finite unitless values; non-negative `stdDeviation`; finite `dx` / `dy`; `feFuncA slope` within `0..1`; mapped glow `rad = stdDeviation × 9525`, shadow `blurRad = stdDeviation × 2 × 9525`, and shadow `dist = hypot(dx,dy) × 9525` must round into DrawingML `0..27273042316900` |
| Classification | Meaningful non-zero offset → one outer shadow; zero/no offset → one glow |
| Fidelity | `Approximate`; one filter becomes one DrawingML effect |
diff --git a/skills/ppt-master/scripts/svg_to_pptx/drawingml/utils.py b/skills/ppt-master/scripts/svg_to_pptx/drawingml/utils.py
index 53b7f918..4e33e353 100644
--- a/skills/ppt-master/scripts/svg_to_pptx/drawingml/utils.py
+++ b/skills/ppt-master/scripts/svg_to_pptx/drawingml/utils.py
@@ -1987,6 +1987,11 @@ def parse_project_filter_params(
color = parsed_color
color_alpha = parsed_alpha
elif tag == 'feGaussianBlur':
+ if child.get('edgeMode') is not None:
+ raise ValueError(
+ '<feGaussianBlur> edgeMode is unsupported by the native '
+ 'effect mapping'
+ )
std_dev = required_number(child, 'stdDeviation')
elif tag == 'feOffset':
dx = _f(child.get('dx'), 0.0)
@@ -2179,6 +2184,15 @@ def project_filter_errors(root: ET.Element) -> list[str]:
f'{label} <feFuncA> intercept is unsupported; project '
'alpha transfer maps slope multiplication only'
)
+ if (
+ primitive_tag == 'feGaussianBlur'
+ and primitive.get('edgeMode') is not None
+ ):
+ parameters_are_valid = False
+ errors.add(
+ f'{label} <feGaussianBlur> edgeMode is unsupported by '
+ 'the native effect mapping'
+ )
numeric_attrs: tuple[tuple[str, bool, bool], ...] = ()
if primitive_tag in {'feDropShadow', 'feGaussianBlur'}:
numeric_attrs = (('stdDeviation', True, True),)
diff --git a/skills/ppt-master/scripts/test_svg_quality_checker.py b/skills/ppt-master/scripts/test_svg_quality_checker.py
index 9f199aac..ced57f7a 100644
--- a/skills/ppt-master/scripts/test_svg_quality_checker.py
+++ b/skills/ppt-master/scripts/test_svg_quality_checker.py
@@ -2582,6 +2582,23 @@ class SVGQualityCheckerCompatibilityTests(unittest.TestCase):
'invalid project filter',
)
+ def test_filter_blur_rejects_unmapped_edge_mode(self):
+ self._assert_checker_and_exporter_reject(
+ '''<svg xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 1280 720">
+ <defs>
+ <filter id="effect">
+ <feGaussianBlur stdDeviation="6" edgeMode="wrap"/>
+ <feFlood flood-color="#000000" flood-opacity="0.4"/>
+ </filter>
+ </defs>
+ <rect x="80" y="80" width="300" height="180"
+ fill="#FFFFFF" filter="url(#effect)"/>
+</svg>''',
+ '<feGaussianBlur> edgeMode is unsupported',
+ 'invalid project filter',
+ )
+
def test_filter_flood_opacity_must_be_explicit(self):
cases = (
(