feat(images): support SVG image imports #2663
No reviewers
Labels
No labels
accepted
bug
declined
docs
duplicate
enhancement
good first issue
in-progress
needs-info
privacy
release-blocker
security
triage
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
LibreKAT/Ocideck!2663
Loading…
Reference in a new issue
No description provided.
Delete branch "jhermans/Ocideck:feat/svg-image-import"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Add SVG vector images as a supported slide and Image Library format. SVGs can be selected, dropped, stored in the Library, copied into saved or unsaved decks, previewed, presented, and exported without losing vector sharpness.
This also fixes two compatibility regressions found during manual testing:
Security trade-off: SVG is active XML rather than an inert raster format, so safety takes precedence over accepting every SVG feature. Import parses the complete, size-bounded document and stores only a renderer-derived allow-list; scripts, event handlers, animation, stylesheets, external URLs, and general
data:URLs are removed. The soledata:exception is a base64 PNG whose signature, decoded size (8 MiB maximum), and dimensions (8192 px per edge maximum) are validated. Arbitrary external paths remain blocked; unsaved slides may render only files OciDeck itself placed under its private staging root. I would broaden this subset only if the renderer can safely isolate additional features without increasing file/network access or executable content.Changes
.svgto desktop/web image pickers, drag-and-drop, and Library scanning.SafeSvgImagefor consistent safe rendering in the Library, slide preview, presenter, audience window, callouts, zoom, and export paths.Checklist
git commit -s) per theDCO, with my real name and a reachable email.
make check-fullpasses locally on the exact commit named inthe PR before merge (format, analysis, tests, coverage, secrets, SAST,
licences and web hardening). Tested commit:
1d14f05d4.SafeSvgImagewas built; it passes on1d14f05d4.context.l10n.d('…')and are translated inevery supported language. No new UI strings were introduced.
docs/FILE_FORMAT.md.docs/SECURITY_DESIGN.mdandassurance/risicoafweging.mdwere revisited. Sanitisation narrows imported SVGs to the existing renderer vocabulary, network references stay blocked, project containment remains enforced, and the unsaved-deck exception is limited to OciDeck's private staging root.Notes for reviewers
Verification on exact commit
1d14f05d4:main. The pre-merge branch also passed its 180 focused import suites.make check-fullis intentionally left for the maintainer checklist item.Suggested manual checks:
data:payload is stripped/rejected rather than executed or fetched.40f416b6f5to1d14f05d4eGemerged via vervangende PR #2666 (merge-commit
55f5cabdaa3f). De inzender-commit1d14f05d4is behouden; daarbovenop staat één maintainer-commit met poortreparaties (format, bestandsplafond, SOURCE_MAP, CHANGELOG) en de begrensde decode van ingebedde PNG (cappedMemoryImage). Bedankt voor de bijdrage!Pull request closed