Bug 56691 - Saving embedded .SVG Graphics in a DOCX document results in a zero sized .SVG file
Summary: Saving embedded .SVG Graphics in a DOCX document results in a zero sized .SVG...
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
3.6.3.2 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: SVG-Save
  Show dependency treegraph
 
Reported: 2012-11-02 18:59 UTC by Emily Bowman
Modified: 2021-03-23 07:40 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Example files (ODG/ODT/SVG/DOCX) showing problem only relates to DOCX. (121.54 KB, application/zip)
2013-06-08 08:39 UTC, Owen Genat (retired)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Emily Bowman 2012-11-02 18:59:43 UTC
When I try to import an SVG and then save it out again from the document, I always get a 0-byte file. If I open the document, the SVG is embedded correctly, so the only problem is that it doesn't save.

It occurs with any SVG I've tested.
Comment 1 João Paulo 2012-11-03 02:20:12 UTC
I tested with "flat_logo.svg" on "LibreOffice 3.6\program" folder and it also not works for me. Confirmed this bug.
Comment 2 Owen Genat (retired) 2013-06-08 08:39:16 UTC
Created attachment 80512 [details]
Example files (ODG/ODT/SVG/DOCX) showing problem only relates to DOCX.

This bug suffers from a lack of detail. Presumably the initial description and first comment refer to inserting an SVG into a Writer document (ODT). If this is the case, then by and large the problem no longer appears reproducable under GNU/Linux TDF/LO v4.0.3.3. 

flat_logo (Inkscape) SVG examples
---------------------------------
The SVG referenced in comment #1 (for v4.0.3.3) has been generated in Inkscape. Inserting this into Writer generates both an SVG and corresponding PNG (both as expected) in the Pictures/ directory of an ODT. Saving the ODT as a DOCX generates the requisite PNG in the word/media/ directory. There is no SVG but that is related to bug #51510.

square_circle_triangle (Draw) SVG examples
------------------------------------------
The ODG was created in Draw and exported as the corresponding SVG. Inserting the SVG into Writer generates both an SVG and corresponding PNG (both as expected) in the Pictures/ directory of an ODT. Saving the ODT as a DOCX generates an 8 byte PNG in the word/media/ directory:

$ ls -l image1.png 
-rw-r--r-- 1 oweng users 8 Jun  8 07:06 image1.png
$ file image1.png 
image1.png: PNG image data
$ file -bi image1.png 
image/png; charset=binary
$ hexdump -n 128 -C image1.png 
00000000  89 50 4e 47 0d 0a 1a 0a                           |.PNG....|
00000008
$ hexdump -n 128 -c image1.png 
0000000 211   P   N   G  \r  \n 032  \n                                
0000008

This would appear to be the only situation (under the current version of LO) where this bug still applies. Tests for Adobe Illustrator generated SVGs are available in bug #51510 and work as expected.
Comment 3 Emily Bowman 2013-06-08 15:09:22 UTC
If it now saves correctly as an ODT, then this specific bug is fixed. It didn't work at all for any OpenDocument format then. Whether you wish to leave it open to reference the DOCX export bug is up to you.
Comment 4 Roman Kuznetsov 2018-06-20 19:37:56 UTC
this really fixed for ODT/ODG formats. i checked it in LO 6.1 beta 2

but if you save image from DOCX to SVG, then Inkscape shows error about zero size of SVG file

this bug didn't have any CC. I added you, men

What do you think about this bug now? may be create a new different bug about export image to SVG from DOCX?
Comment 5 Buovjaga 2018-06-21 11:00:23 UTC
Let's keep this alive. It was DOCX-only already in 2013 as Owen confirmed.
Comment 6 Cor Nouws 2020-07-03 21:58:40 UTC
Hi I think this is the problem from bug 51510

*** This bug has been marked as a duplicate of bug 51510 ***
Comment 7 Mike Kaganski 2021-03-23 07:40:51 UTC
No reason to pick a random "image is saved *corrupted*" (0-byte!), and convert it into a dupe of "low image quality".
This is WORKSFORME.