Don't use IMG_BROKEN as png preview for all local / data url svg files on node #1315
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix issue #963
The problem is that the png preview of svgs are used by LibreOffice impress, while MS PowerPoint uses the svg directly.
However, Impress shows svg files fine, and don't need the png.
The same problem shows up in web preview of the pptx file if it's shared in Slack. I guess they maybe use LibreOffice to render the preview server side.
In the demo, the svg that is downloaded from Wikipedia show up fine, because PptxGenJS simply renames the svg to png and uses it as a "preview". However, the svg loaded from data url or from a local file will use the placeholder IMG_BROKEN png.
Here's the relevant part of the generated slide1.xml file for slide 1 created by the
node demo.js Image
exampleLibreoffice will use the first embed "rId10", while powerpoint will display the inner one "rId11".
This PR will make local files and data urls work the same as http url svgs. The svg will be renamed to png and used as its own preview. Which seems to have caused no problems since #528 in 2019.
However. I don't really understand the reason behind the "png preview" and the
<a:ext uri="{96DAC541-7B7A-43D3-8B79-37D633B846F1}">
tag at all. If you embed a svg using LibreOffice it will simply be included as<a:blip r:embed="rId10">
like any other image, and it seems to display fine everywhere.