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(pptx-to-svg): expose picture and group effect loss

hugohe3bb63a3a0eb9b
diff --git a/docs/powerpoint-svg-mapping.md b/docs/powerpoint-svg-mapping.md
index 00c5c4b3..671bcddb 100644
--- a/docs/powerpoint-svg-mapping.md
+++ b/docs/powerpoint-svg-mapping.md
@@ -158,11 +158,11 @@ preset selection and authoring behavior are documented in
| Dashed or dotted outline | Registered dash array | Preset or custom DrawingML dash | `Native-normalized` | Unsupported dash semantics are rejected |
| Line cap and join | Registered cap/join values | Native line cap/join properties | `Native-stable` | Only documented values are accepted |
| Line arrowheads | Registered start/end markers | Native head/tail end properties | `Approximate` for marker size | See the conditional marker contract |
-| Outer shadow | One supported shadow filter graph | Native outer shadow in `a:effectLst` | `Approximate`; one imported source `outerShdw` is reconstructed only when its non-zero offset remains classifiable | Zero-offset source shadows and unsupported graph shapes are not silently reclassified |
-| Glow | One supported glow filter graph | Native glow in `a:effectLst` | `Approximate`; one imported source glow keeps the registered radius conversion | Review when the glow carries semantic emphasis |
+| Outer shadow | One supported shadow filter graph | Native outer shadow in `a:effectLst` | `Approximate`; one imported shape/connector source `outerShdw` is reconstructed only when its non-zero offset remains classifiable | Zero-offset source shadows and unsupported graph shapes are not silently reclassified |
+| Glow | One supported glow filter graph | Native glow in `a:effectLst` | `Approximate`; one imported shape/connector source glow keeps the registered radius conversion | Review when the glow carries semantic emphasis |
| Whole-object transparency | Atomic element `opacity` | Alpha distributed into supported native channels | `Native-normalized` | Prefer channel-specific alpha unless the whole atomic object fades |
| Group transparency | Compatible `<g opacity>` | Descendant-normalized approximation | `Approximate` with a warning | Generated SVG should prefer descendant alpha |
-| Inner shadow, soft edge, reflection, blur, turbulence, blend mode, or arbitrary mask | No registered native mapping | Explicit geometry alternative or raster asset | `Bake-required`; shape/connector PPTX import keeps the base object and emits blocking effect-status diagnostics for source effect containers | Handled shape/connector effects cannot be reclassified or omitted; picture, group, and text-run source effects remain outside this diagnostic path |
+| Inner shadow, soft edge, reflection, blur, turbulence, blend mode, or arbitrary mask | No registered native mapping | Explicit geometry alternative or raster asset | `Bake-required`; PPTX import keeps the base object and emits blocking diagnostics for unsupported shape/connector effects, picture/group effect DAGs, and non-empty picture/group effect lists | Handled object effects cannot be reclassified or omitted; text-run source effects remain outside this diagnostic path |
## 7. PowerPoint tables
diff --git a/docs/zh/powerpoint-svg-mapping.md b/docs/zh/powerpoint-svg-mapping.md
index 29e35db3..49029ec3 100644
--- a/docs/zh/powerpoint-svg-mapping.md
+++ b/docs/zh/powerpoint-svg-mapping.md
@@ -153,11 +153,11 @@ PowerPoint 意图
| 虚线或点线轮廓 | 已登记 dash array | 预设或自定义 DrawingML dash | `Native-normalized` | 拒绝不支持的 dash 语义 |
| 线端与连接样式 | 已登记 cap/join 值 | 原生 line cap/join 属性 | `Native-stable` | 仅接受文档化取值 |
| 线条箭头 | 已登记起点/终点 marker | 原生 head/tail end 属性 | marker 大小为 `Approximate` | 见条件 marker 合同 |
-| 外阴影 | 一个受支持 shadow filter 图 | `a:effectLst` 中的原生外阴影 | `Approximate`;仅当非零偏移仍可稳定分类时,才重建单一来源 `outerShdw` | 零偏移来源阴影和不支持的图结构不会被静默改成其他效果 |
-| 发光 | 一个受支持 glow filter 图 | `a:effectLst` 中的原生发光 | `Approximate`;单一来源发光保持已登记的半径换算 | 发光承载语义强调时需复核 |
+| 外阴影 | 一个受支持 shadow filter 图 | `a:effectLst` 中的原生外阴影 | `Approximate`;仅当非零偏移仍可稳定分类时,才重建单一 shape/connector 来源 `outerShdw` | 零偏移来源阴影和不支持的图结构不会被静默改成其他效果 |
+| 发光 | 一个受支持 glow filter 图 | `a:effectLst` 中的原生发光 | `Approximate`;单一 shape/connector 来源发光保持已登记的半径换算 | 发光承载语义强调时需复核 |
| 整个对象透明度 | 原子元素 `opacity` | alpha 分发至受支持原生通道 | `Native-normalized` | 除非整个原子对象需要淡出,否则优先通道专属 alpha |
| 组透明度 | 兼容 `<g opacity>` | 后代归一化近似 | `Approximate`,并产生 warning | 生成 SVG 应优先后代 alpha |
-| 内阴影、柔化边缘、倒影、模糊、湍流、混合模式或任意 mask | 无已登记原生映射 | 显式几何替代或栅格资产 | `Bake-required`;shape/connector 的 PPTX 回导保留基础对象,并对来源效果容器产生阻塞性的效果状态诊断 | 已处理的 shape/connector 效果不能被改成其他类型或静默省略;图片、组和文字 run 的来源效果尚不在该诊断路径内 |
+| 内阴影、柔化边缘、倒影、模糊、湍流、混合模式或任意 mask | 无已登记原生映射 | 显式几何替代或栅格资产 | `Bake-required`;PPTX 回导保留基础对象,并对不支持的 shape/connector 效果、图片/组效果 DAG 及非空图片/组效果列表产生阻塞诊断 | 已处理的对象效果不能被改成其他类型或静默省略;文字 run 的来源效果尚不在该诊断路径内 |
## 7. PowerPoint 表格
diff --git a/skills/ppt-master/references/shared-standards.md b/skills/ppt-master/references/shared-standards.md
index 315b0cd1..1629e8be 100644
--- a/skills/ppt-master/references/shared-standards.md
+++ b/skills/ppt-master/references/shared-standards.md
@@ -276,7 +276,7 @@ attributes, and no separate source-payload opt-in marker exists.
| `data-pptx-geometry-kind="custom"` + `data-pptx-custgeom` | Custom-geometry carrier | Preserve the validated original `a:custGeom` subtree. If the visible path hash is unchanged, export restores formulas, handles, connection sites, text rectangle, and path list exactly; edited paths compile from current SVG geometry. |
| `data-pptx-start/end-shape-id/site` | Connector logical `<g>` and carrier | Restore `a:stCxn` / `a:endCxn` after scoped shape-id allocation. A connector may retain one zero frame axis; it must not be expanded from visible stroke or marker bounds. |
| `data-pptx-shape-style` | Native carrier | Preserve a relationship-free `p:style` independently of text, including shapes with no visible text. |
-| `data-pptx-effect-status="unsupported"` + `data-pptx-effect-reason` | Imported `p:sp` / `p:cxnSp` logical shape and native carrier | Record why an encountered source `effectLst` / `effectDag` cannot enter the one-effect shadow/glow mapping without changing semantics. Checker and export stop with the recorded reason; these attributes are diagnostics, not a preserved effect payload or authoring syntax. |
+| `data-pptx-effect-status="unsupported"` + `data-pptx-effect-reason` | Imported `p:sp` / `p:cxnSp` logical object and native carrier; imported `p:pic` carrier and logical object; imported `p:grpSp` logical group | Record why an encountered source `effectLst` / `effectDag` cannot enter the registered target-specific effect mapping without changing semantics. Checker and export stop with the recorded reason; these attributes are diagnostics, not a preserved effect payload or authoring syntax. |
| `metadata[data-pptx-part="txbody"]` | Logical shape `<g>` | Preserve unchanged `p:txBody`, including an empty text body. Content, whitespace, positioning, or visible typography edits invalidate the payload and use the normal SVG text fallback. |
**Import/authoring representation split**:
@@ -780,6 +780,10 @@ Each supported source effect must contain exactly one resolvable DrawingML
color choice. Malformed choices and valid color semantics outside the
registered color/modifier subset also receive effect-status metadata; the
importer never substitutes black or drops an unhandled modifier.
+Picture and group targets do not expose the public filter mapping: any source
+effect DAG or non-empty effect list on `p:pic/p:spPr` or `p:grpSp/p:grpSpPr`
+keeps the base object but receives effect-status metadata instead of attaching
+an invalid filter to `<image>` or ordinary `<g>`.
The quality checker and exporter preflight enforce the same definition,
reference, primitive, target, and numeric-value contract; malformed values are
never replaced by effect defaults during native export.
@@ -1304,16 +1308,16 @@ halftone and route dense full-slide texture to §6.12.
glow; it does not blur the object or backdrop. Use a low-alpha raster for dense
grain and explicit circles/paths only for sparse editable marks.
-**Hard rule — unsupported imported shape effects remain explicit**:
-`pptx_to_svg.py` keeps the underlying `p:sp` / `p:cxnSp` object but stamps
-blocking effect-status metadata for inner shadow, object blur, soft edge,
-reflection, multiple effects, and effect DAGs.
+**Hard rule — unsupported imported object effects remain explicit**:
+`pptx_to_svg.py` keeps the underlying object but stamps blocking effect-status
+metadata for unsupported shape/connector effects and for every picture/group
+effect DAG or non-empty effect list.
Before release export, rasterize the affected object from the source PPTX or
rebuild its effect with supported explicit geometry; baking the effect-less
analysis SVG alone cannot recover the source appearance. This diagnostic path
-currently covers `p:sp` / `p:cxnSp`; picture, group, and text-run source effects
-remain outside it and are not claimed as preserved. Handled shape/connector
-effects must never become outer shadow/glow or disappear without a diagnostic.
+covers `p:sp`, `p:cxnSp`, `p:pic`, and `p:grpSp` source effects. Text-run source
+effects remain outside it and are not claimed as preserved. Handled object
+effects must never become a different effect or disappear without a diagnostic.
---
diff --git a/skills/ppt-master/scripts/pptx_effects.py b/skills/ppt-master/scripts/pptx_effects.py
index a5f1120f..88464272 100644
--- a/skills/ppt-master/scripts/pptx_effects.py
+++ b/skills/ppt-master/scripts/pptx_effects.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
-"""Shared diagnostic contract for unsupported imported shape effects."""
+"""Shared diagnostic contract for unsupported imported object effects."""
from __future__ import annotations
@@ -9,6 +9,11 @@ from xml.etree import ElementTree as ET
EFFECT_STATUS_ATTR = "data-pptx-effect-status"
EFFECT_REASON_ATTR = "data-pptx-effect-reason"
UNSUPPORTED_EFFECT_STATUS = "unsupported"
+_EFFECT_OBJECT_IDENTITY_ATTRS = (
+ "data-pptx-object",
+ "data-pptx-shape-id",
+ "data-pptx-shape-scope",
+)
def project_effect_status_errors(root: ET.Element) -> list[str]:
@@ -29,6 +34,7 @@ def project_effect_status_errors(root: ET.Element) -> list[str]:
parent is not None
and parent.get(EFFECT_STATUS_ATTR) == raw_status
and parent.get(EFFECT_REASON_ATTR) == raw_reason
+ and _same_source_object(parent, elem)
):
# Import duplicates the marker on the logical object and carrier
# so stripping either copy cannot erase the block. Report it once.
@@ -65,4 +71,24 @@ def unsupported_effect_metadata(reason: str) -> dict[str, str]:
def _element_label(elem: ET.Element) -> str:
tag = elem.tag.rsplit("}", 1)[-1]
elem_id = elem.get("id") or elem.get("data-name")
- return f'<{tag} id="{elem_id}">' if elem_id else f"<{tag}>"
+ if elem_id:
+ return f'<{tag} id="{elem_id}">'
+ shape_id = elem.get("data-pptx-shape-id")
+ if shape_id:
+ object_kind = elem.get("data-pptx-object") or "object"
+ scope = elem.get("data-pptx-shape-scope") or "unknown"
+ return (
+ f'<{tag} data-pptx-object="{object_kind}" '
+ f'data-pptx-shape-id="{shape_id}" '
+ f'data-pptx-shape-scope="{scope}">'
+ )
+ return f"<{tag}>"
+
+
+def _same_source_object(parent: ET.Element, child: ET.Element) -> bool:
+ """Return whether a parent/child marker describes one imported object."""
+ return all(
+ child.get(attr) is not None
+ and child.get(attr) == parent.get(attr)
+ for attr in _EFFECT_OBJECT_IDENTITY_ATTRS
+ )
diff --git a/skills/ppt-master/scripts/pptx_to_svg/effect_to_svg.py b/skills/ppt-master/scripts/pptx_to_svg/effect_to_svg.py
index 88df4930..c8d045ea 100644
--- a/skills/ppt-master/scripts/pptx_to_svg/effect_to_svg.py
+++ b/skills/ppt-master/scripts/pptx_to_svg/effect_to_svg.py
@@ -56,6 +56,36 @@ class EffectResult:
return cls(metadata=tuple(unsupported_effect_metadata(reason).items()))
+def unsupported_target_effect_metadata(
+ sp_pr: ET.Element | None,
+ target: str,
+) -> dict[str, str]:
+ """Mark source effects that cannot attach to this SVG target type."""
+ if sp_pr is None:
+ return {}
+ effect_names: list[str] = []
+ for container in sp_pr:
+ if (
+ not isinstance(container.tag, str)
+ or _local_name(container) not in _EFFECT_CONTAINER_NAMES
+ ):
+ continue
+ container_name = _local_name(container)
+ if container_name == "effectDag":
+ effect_names.append(container_name)
+ continue
+ effect_names.extend(
+ _local_name(child)
+ for child in container
+ if isinstance(child.tag, str)
+ )
+ if not effect_names:
+ return {}
+ return unsupported_effect_metadata(
+ f"unsupported-effect-target:{target}:" + ",".join(effect_names)
+ )
+
+
def convert_effects(
sp_pr: ET.Element | None,
palette: ColorPalette | None,
diff --git a/skills/ppt-master/scripts/pptx_to_svg/slide_to_svg.py b/skills/ppt-master/scripts/pptx_to_svg/slide_to_svg.py
index 76eb40f0..bdb7f848 100644
--- a/skills/ppt-master/scripts/pptx_to_svg/slide_to_svg.py
+++ b/skills/ppt-master/scripts/pptx_to_svg/slide_to_svg.py
@@ -40,7 +40,7 @@ from pptx_effects import EFFECT_REASON_ATTR, EFFECT_STATUS_ATTR
from .color_resolver import ColorPalette, find_color_elem, resolve_color
from .chart_to_svg import CHART_URI, CHARTEX_URI, extract_native_chart_payload
from .custgeom_to_svg import convert_custom_geom
-from .effect_to_svg import convert_effects
+from .effect_to_svg import convert_effects, unsupported_target_effect_metadata
from .emu_units import NS, Xfrm, fmt_num, format_canvas_px_from_emu
from .fill_to_svg import resolve_fill
from .ln_to_svg import resolve_stroke
@@ -662,8 +662,21 @@ def _convert_picture(node: ShapeNode, ctx: AssemblyContext, *, top_level: bool)
if not result.svg:
return ""
ctx.media.update(result.media)
- picture_svg = _inject_root_svg_attrs(result.svg, _object_metadata(node, ctx))
- return _wrap_shape_group(picture_svg, node, ctx, top_level=top_level)
+ effect_metadata = unsupported_target_effect_metadata(
+ node.xml.find("p:spPr", NS),
+ "picture",
+ )
+ picture_svg = _inject_root_svg_attrs(
+ result.svg,
+ {**_object_metadata(node, ctx), **effect_metadata},
+ )
+ return _wrap_shape_group(
+ picture_svg,
+ node,
+ ctx,
+ top_level=top_level,
+ extra_attrs=_metadata_group_attrs(effect_metadata),
+ )
def _inject_root_svg_attrs(markup: str, attrs: dict[str, str]) -> str:
@@ -707,7 +720,17 @@ def _convert_group(node: ShapeNode, ctx: AssemblyContext, *, top_level: bool) ->
if not inner_parts:
return ""
inner = "\n".join(inner_parts)
- return _wrap_shape_group(inner, node, ctx, top_level=top_level)
+ effect_metadata = unsupported_target_effect_metadata(
+ node.xml.find("p:grpSpPr", NS),
+ "group",
+ )
+ return _wrap_shape_group(
+ inner,
+ node,
+ ctx,
+ top_level=top_level,
+ extra_attrs=_metadata_group_attrs(effect_metadata),
+ )
# ---------------------------------------------------------------------------
@@ -1210,6 +1233,14 @@ def _attrs_to_xml(attrs: dict[str, str]) -> str:
return "".join(f' {key}="{_xml_escape(value)}"' for key, value in attrs.items())
+def _metadata_group_attrs(attrs: dict[str, str]) -> list[str]:
+ """Serialize import metadata for a logical object wrapper."""
+ return [
+ f'{key}="{_xml_escape(value)}"'
+ for key, value in attrs.items()
+ ]
+
+
def _geometry_group_attrs(geom: GeomResult | None) -> list[str]:
"""Mirror native geometry semantics onto the logical shape container."""
if geom is None:
diff --git a/skills/ppt-master/scripts/svg_to_pptx/drawingml/elements.py b/skills/ppt-master/scripts/svg_to_pptx/drawingml/elements.py
index ef4ed36c..94354bb0 100644
--- a/skills/ppt-master/scripts/svg_to_pptx/drawingml/elements.py
+++ b/skills/ppt-master/scripts/svg_to_pptx/drawingml/elements.py
@@ -23,6 +23,7 @@ from pptx_shapes import (
load_shape_type_values,
validate_ooxml_xfrm,
)
+from pptx_effects import EFFECT_REASON_ATTR, EFFECT_STATUS_ATTR
from pptx_to_svg.preset_authoring import AUTHORING_ATTR, AUTHORING_VALUE
from resource_paths import resolve_external_image_reference
@@ -4025,6 +4026,8 @@ class NestedSvgCropSpec:
_NESTED_CROP_OUTER_ATTRIBUTES = frozenset({
'clip-path',
'data-pptx-crop',
+ EFFECT_REASON_ATTR,
+ EFFECT_STATUS_ATTR,
'data-pptx-frame',
'data-pptx-layer',
'data-pptx-object',
diff --git a/skills/ppt-master/scripts/test_svg_quality_checker.py b/skills/ppt-master/scripts/test_svg_quality_checker.py
index 525b2e9e..58e8f043 100644
--- a/skills/ppt-master/scripts/test_svg_quality_checker.py
+++ b/skills/ppt-master/scripts/test_svg_quality_checker.py
@@ -37,7 +37,10 @@ from pptx_to_svg.preset_authoring import (
validate_authored_preset_tree,
)
from pptx_to_svg.emu_units import Xfrm
-from pptx_to_svg.effect_to_svg import convert_effects
+from pptx_to_svg.effect_to_svg import (
+ convert_effects,
+ unsupported_target_effect_metadata,
+)
from pptx_to_svg.preset_registry_to_svg import render_preset_geometry
from pptx_to_svg.preset_svg_markup import serialize_preset_layers
from pptx_to_svg.converter import ConvertOptions, convert_pptx_to_svg
@@ -267,6 +270,89 @@ class SVGQualityCheckerCompatibilityTests(unittest.TestCase):
target.writestr(info, replacements.get(info.filename, data))
rewritten.replace(path)
+ @classmethod
+ def _write_picture_group_effect_fixture(cls, path: Path) -> None:
+ """Write one real picture and one group with source effects."""
+ presentation = Presentation()
+ slide = presentation.slides.add_slide(presentation.slide_layouts[6])
+ image_bytes = base64.b64decode(cls._TINY_PNG_URI.split(',', 1)[1])
+ picture = slide.shapes.add_picture(
+ io.BytesIO(image_bytes),
+ Emu(914400),
+ Emu(914400),
+ Emu(914400),
+ Emu(914400),
+ )
+ picture.name = 'EFFECT PICTURE'
+ group = slide.shapes.add_group_shape()
+ group.name = 'EFFECT GROUP'
+ group.shapes.add_shape(
+ MSO_SHAPE.RECTANGLE,
+ Emu(2743200),
+ Emu(914400),
+ Emu(1371600),
+ Emu(914400),
+ )
+ presentation.save(path)
+
+ pml = 'http://schemas.openxmlformats.org/presentationml/2006/main'
+ dml = 'http://schemas.openxmlformats.org/drawingml/2006/main'
+ with zipfile.ZipFile(path, 'r') as source:
+ members = [(info, source.read(info.filename)) for info in source.infolist()]
+ slide_part = 'ppt/slides/slide1.xml'
+ member_data = {info.filename: data for info, data in members}
+ slide_root = ET.fromstring(member_data[slide_part])
+
+ picture_xml = next(
+ elem
+ for elem in slide_root.findall(f'.//{{{pml}}}pic')
+ if elem.find(f'{{{pml}}}nvPicPr/{{{pml}}}cNvPr').get('name')
+ == 'EFFECT PICTURE'
+ )
+ picture_sp_pr = picture_xml.find(f'{{{pml}}}spPr')
+ assert picture_sp_pr is not None
+ blip_fill = picture_xml.find(f'{{{pml}}}blipFill')
+ assert blip_fill is not None
+ blip = blip_fill.find(f'{{{dml}}}blip')
+ assert blip is not None
+ blip_fill.insert(
+ list(blip_fill).index(blip) + 1,
+ ET.fromstring(
+ f'<a:srcRect xmlns:a="{dml}" '
+ 'l="10000" t="10000" r="10000" b="10000"/>'
+ ),
+ )
+ picture_sp_pr.append(ET.fromstring(f'''<a:effectLst xmlns:a="{dml}">
+ <a:outerShdw blurRad="38100" dist="38100" dir="5400000">
+ <a:srgbClr val="000000"/>
+ </a:outerShdw>
+</a:effectLst>'''))
+
+ group_xml = next(
+ elem
+ for elem in slide_root.findall(f'.//{{{pml}}}grpSp')
+ if elem.find(f'{{{pml}}}nvGrpSpPr/{{{pml}}}cNvPr').get('name')
+ == 'EFFECT GROUP'
+ )
+ group_sp_pr = group_xml.find(f'{{{pml}}}grpSpPr')
+ assert group_sp_pr is not None
+ group_sp_pr.append(ET.fromstring(
+ f'<a:effectLst xmlns:a="{dml}"><a:reflection/></a:effectLst>'
+ ))
+
+ replacements = {
+ slide_part: ET.tostring(
+ slide_root,
+ encoding='utf-8',
+ xml_declaration=True,
+ ),
+ }
+ rewritten = path.with_name(f'{path.stem}-rewritten.pptx')
+ with zipfile.ZipFile(rewritten, 'w') as target:
+ for info, data in members:
+ target.writestr(info, replacements.get(info.filename, data))
+ rewritten.replace(path)
+
@staticmethod
def _text_bound_warnings(result: dict) -> list[str]:
return [
@@ -2446,6 +2532,99 @@ class SVGQualityCheckerCompatibilityTests(unittest.TestCase):
):
convert_svg_to_slide_shapes(artifact_path)
+ def test_picture_and_group_effect_import_is_explicit(self):
+ dml = 'http://schemas.openxmlformats.org/drawingml/2006/main'
+ empty_sp_pr = ET.fromstring(
+ f'<p:spPr xmlns:p="http://schemas.openxmlformats.org/'
+ f'presentationml/2006/main" xmlns:a="{dml}">'
+ '<a:effectLst/></p:spPr>'
+ )
+ self.assertEqual(
+ unsupported_target_effect_metadata(empty_sp_pr, 'picture'),
+ {},
+ )
+ nested_groups = ET.fromstring('''<svg>
+ <g data-pptx-object="group" data-pptx-shape-id="10"
+ data-pptx-shape-scope="slide" data-pptx-effect-status="unsupported"
+ data-pptx-effect-reason="unsupported-effect-target:group:reflection">
+ <g data-pptx-object="group" data-pptx-shape-id="11"
+ data-pptx-shape-scope="slide" data-pptx-effect-status="unsupported"
+ data-pptx-effect-reason="unsupported-effect-target:group:reflection"/>
+ </g>
+</svg>''')
+ self.assertEqual(len(project_effect_status_errors(nested_groups)), 2)
+
+ with tempfile.TemporaryDirectory() as tmp_dir:
+ root_dir = Path(tmp_dir)
+ pptx_path = root_dir / 'target-effects.pptx'
+ self._write_picture_group_effect_fixture(pptx_path)
+ imported = convert_pptx_to_svg(
+ pptx_path,
+ options=ConvertOptions(
+ inheritance_mode='flat',
+ embed_images=True,
+ ),
+ )
+ self.assertEqual(len(imported.slides), 1)
+ svg = imported.slides[0].svg
+ root = ET.fromstring(svg)
+ status_errors = project_effect_status_errors(root)
+ self.assertEqual(len(status_errors), 2)
+ self.assertTrue(any(
+ 'unsupported-effect-target:picture:outerShdw' in error
+ for error in status_errors
+ ))
+ self.assertTrue(any(
+ 'unsupported-effect-target:group:reflection' in error
+ for error in status_errors
+ ))
+ marked = [
+ elem
+ for elem in root.iter()
+ if elem.get('data-pptx-effect-status') == 'unsupported'
+ ]
+ self.assertEqual(len(marked), 3)
+ self.assertEqual(
+ sum(elem.get('data-pptx-object') == 'picture' for elem in marked),
+ 2,
+ )
+ self.assertEqual(
+ sum(elem.get('data-pptx-object') == 'group' for elem in marked),
+ 1,
+ )
+ self.assertNotIn('<filter', svg)
+ self.assertTrue(any(
+ elem.tag.endswith('svg')
+ and elem.get('data-pptx-object') == 'picture'
+ for elem in root.iter()
+ ))
+ self.assertTrue(any(
+ elem.tag.endswith('image')
+ for elem in root.iter()
+ ))
+ self.assertTrue(any(
+ elem.get('data-pptx-object') == 'shape'
+ for elem in root.iter()
+ ))
+
+ svg_path = root_dir / 'target-effects.svg'
+ svg_path.write_text(svg, encoding='utf-8')
+ checker_result = SVGQualityChecker().check_file(str(svg_path))
+ self.assertFalse(checker_result['passed'])
+ self.assertEqual(len(checker_result['errors']), 2)
+ self.assertEqual(
+ sum(
+ 'unsupported source PPTX effect' in error
+ for error in checker_result['errors']
+ ),
+ 2,
+ )
+ with self.assertRaisesRegex(
+ SvgNativeConversionError,
+ 'unsupported imported PPTX effect',
+ ):
+ convert_svg_to_slide_shapes(svg_path)
+
def test_missing_paint_reference_blocks_checker_and_exporter(self):
self._assert_checker_and_exporter_reject(
'''<svg xmlns="http://www.w3.org/2000/svg"