Bug 126084 - DOCX/OOXML support of SVG images via Office Drawing extension and fallback (published schema)
Summary: DOCX/OOXML support of SVG images via Office Drawing extension and fallback (p...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard: target:24.2.0
Keywords:
: 139516 (view as bug list)
Depends on:
Blocks: DOCX-Images
  Show dependency treegraph
 
Reported: 2019-06-25 12:37 UTC by d5ous.dev
Modified: 2023-12-08 02:55 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
*.docx file containing an SVG using the `svgBlip` extension (51.26 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2019-08-12 05:14 UTC, d5ous.dev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description d5ous.dev 2019-06-25 12:37:18 UTC
Description:
A recent, briefly-specified Office Drawing Extension (adding the svgBlip tag) allows SVG content to be embedded in OOXML WordprocessingML without loss of backward-readability. See: 

https://docs.microsoft.com/en-us/openspecs/office_standards/ms-odrawxml/06cff208-c6e1-4db7-bb68-665135e5f0de

LibreOffice does not appear to avail itself of this mechanism.

Without knowing the criteria for selecting OOXML extensions supported by LibreOffice: I'll just observe that SVG images are pretty widespread, and LibreOffice is even now able to read SVG "improperly" embedded in OOXML as if it was any other supported format.

This extension is briefly discussed in the context of the pandoc project here (including XML snippet):

https://github.com/jgm/pandoc/issues/4058

May also be relevant to bug #121831.




Steps to Reproduce:
1. Embed SVG in OOXML WordprocessingML document using a recent (2016+?) version of Office Word
2. Open in LibreOffice.


Actual Results:
SVG is suppressed, PNG fallback is used instead.

Expected Results:
If the extension was supported, SVG would be displayed.


Reproducible: Always


User Profile Reset: No



Additional Info:
For what it's worth, manually replacing the PNG fallback image reference with a reference to the SVG image actually allows the SVG to be displayed. The resulting image reference is not accepted by Word, however.
Comment 1 Tomaz Vajngerl 2019-06-25 13:23:54 UTC
Oh my... Microsoft is "inventing" again.
Comment 2 Tomaz Vajngerl 2019-06-25 13:24:59 UTC
BTW. An example document would be nice to have.
Comment 3 d5ous.dev 2019-08-12 05:14:59 UTC
Created attachment 153314 [details]
*.docx file containing an SVG using the `svgBlip` extension

Relevant snippet from `document.xml` inside:

<a:blip r:embed="rId4">
  <a:extLst>
    <a:ext uri="{28A0092B-C50C-407E-A947-70E740481C1C}">
      <a14:useLocalDpi xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main" val="0"/>
    </a:ext>
    <a:ext uri="{96DAC541-7B7A-43D3-8B79-37D633B846F1}">
      <asvg:svgBlip xmlns:asvg="http://schemas.microsoft.com/office/drawing/2016/SVG/main" r:embed="rId5"/>
    </a:ext>
  </a:extLst>
</a:blip>
Comment 4 d5ous.dev 2019-08-12 05:18:24 UTC
The example attached elicits the following behaviors:

* LibreOffice 6.2.2.2 -- PNG used (pixelated rendering at magnified views)
* Word 2010 (pre-extension) -- PNG used
* Word for Office 365 (16.0.11727.20244/13-Jul-2019) -- SVG used (smooth rendering at magnified views)
Comment 5 NISZ LibreOffice Team 2021-04-28 08:47:41 UTC
*** Bug 139516 has been marked as a duplicate of this bug. ***
Comment 6 Damian Hofmann 2021-08-04 12:00:43 UTC
Just encountered this issue with LO 7.1.4. Would be very cool if this could be fixed.
Comment 7 Justin L 2023-06-08 16:49:58 UTC
repro 7.6
Comment 8 Johannes Weberhofer 2023-08-07 16:03:47 UTC
We are currently testing embedding images with Apache poi producing xlsx files and see the same behavior.

When we leave out the fallback-raster-grapic completely, LO shows nothing.
Comment 9 Commit Notification 2023-12-04 09:34:32 UTC
Tomaž Vajngerl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/bfbbf06bcea4d58117c14fd3f3b8743a3714f97e

tdf#126084 support writing SVG images into OOXML using the MS OOXML extension

It will be available in 24.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Commit Notification 2023-12-06 07:24:27 UTC
Tomaž Vajngerl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/1db193c6c744289139b1df2af0b8defcf974b238

tdf#126084 import svg image from ooxml document that use svgBlip elem.

It will be available in 24.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2023-12-08 02:55:58 UTC
Tomaž Vajngerl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/a010567c2cdb8ea0fe059b0b64fd5d1f2fd99a03

tdf#126084 document OOXML SVG tests and import

It will be available in 24.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.