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): resolve template-copied image href under project templates/ (#186)

Kaimar886432a7f4fa
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 c006523c..9f78219e 100644
--- a/skills/ppt-master/scripts/svg_to_pptx/drawingml_elements.py
+++ b/skills/ppt-master/scripts/svg_to_pptx/drawingml_elements.py
@@ -1689,6 +1689,8 @@ def convert_image(elem: ET.Element, ctx: ConvertContext) -> ShapeResult | None:
img_path = ctx.svg_dir / href
if not img_path.exists():
img_path = ctx.svg_dir.parent / href
+ if not img_path.exists():
+ img_path = ctx.svg_dir.parent / 'templates' / href
if not img_path.exists():
raise FileNotFoundError(f'External image not found: {href}')
img_format = img_path.suffix.lstrip('.').lower()
@@ -1890,6 +1892,8 @@ def convert_nested_svg(elem: ET.Element, ctx: ConvertContext) -> ShapeResult | N
img_path = ctx.svg_dir / href
if not img_path.exists():
img_path = ctx.svg_dir.parent / href
+ if not img_path.exists():
+ img_path = ctx.svg_dir.parent / 'templates' / href
if not img_path.exists():
raise FileNotFoundError(f'External image not found: {href}')
img_format = img_path.suffix.lstrip('.').lower()