Bug 115898 - Add an option to disable SVG or SVM files replacement in PNG format for ODF
Summary: Add an option to disable SVG or SVM files replacement in PNG format for ODF
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.0.1.1 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsUXEval
Depends on:
Blocks: Options-Dialog-Load-Save
  Show dependency treegraph
 
Reported: 2018-02-21 08:40 UTC by odinatlas
Modified: 2022-01-23 13:45 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Test.odt (31.48 KB, application/vnd.oasis.opendocument.text)
2018-02-21 08:42 UTC, odinatlas
Details
Size_on_LO_5_229kb (229.83 KB, application/vnd.oasis.opendocument.text)
2018-04-03 23:45 UTC, odinatlas
Details
Size_on_LO_6_810kb (810.52 KB, application/vnd.oasis.opendocument.text)
2018-04-03 23:46 UTC, odinatlas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description odinatlas 2018-02-21 08:40:19 UTC
Description:
SVG images in ODF would have an extra copy of PNG format, which makes the file size become large. Is it intentional? If yes, why?

Opening files with SVG images inside or SVM starview metafile in LibreOffice and saving as ODF format files, the file sizes became much more. Then the user found that under the Pictures folder of ODF format files, all the SVG and SVM files had a copy of PNG format, which made the file size became much more than the original file.

The SVG files were made by Apache OpenOffice, In AOO it wouldn't have a PNG copy, But SVM files.

Is this behavior intentional? Would anyone please tell us what it is for? Besides, is there any expert options to control this behavior, i.e., to control if a PNG copy is made or not?

If png version is included to help consumers, which are not able to read svg-images. For example Word got only recently the ability to read svg-images. Including different representations of the same content is explicitly allowed in file format for this purpose.

But now the SVG was general standard, many programs can open or view it, So give up those PNG copy and restore ODT size, maybe it is a good idea, Moreover, SVM files were not have PNG copy, when convert ODF format files include svm files, svm files were be converted to emf files.

Steps to Reproduce:
1.Create an document, odt,ods,odp or odg
2.past vector illustration file as GDI metafile.
3.Save ODF format file
4.Open ODF format file with 7-zip, the pictures folder will have PNG copy files.

Actual Results:  
Every SVG or SVM files in ODF format had an PNG copy, It will increase ODF format file sizes, If have many ODF format files that include a lot of SVG or SVM, Will need many storage space, for government, Large Mechanism and company, It is not a good situation.

Expected Results:
Wish create an option to disable SVG or SVM files in ODF(odt,ods,odp,odg) wont copy of PNG format.
So can reduce LibreOffice ODF format files sizes.


Reproducible: Always


User Profile Reset: Yes



Additional Info:
[Information automatically included from LibreOffice]
Locale: zh-TW
Module: StartModule
[Information guessed from browser]
OS: Windows (All)
OS is 64bit: no


User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:54.0) Gecko/20100101 Firefox/54.0
Comment 1 odinatlas 2018-02-21 08:42:52 UTC
Created attachment 140031 [details]
Test.odt
Comment 2 Buovjaga 2018-03-07 16:44:29 UTC
Origin: https://ask.libreoffice.org/en/question/146942/svg-images-in-odf-would-have-an-extra-copy-of-png-format-which-makes-the-file-size-become-large-is-it-intentional-if-yes-why/

As with all options, this needs to fly by the Guardians of the Design Galaxy.
Comment 3 Heiko Tietze 2018-03-20 12:52:13 UTC
Not so sure that UX is needed here. But Tomaz is! Please enlighten us.
Comment 4 V Stuart Foote 2018-03-20 15:38:30 UTC
Tomaž may have better insight--but I believe this has more to do with internals of handling the SVG (and other vector formats). We keep the SVG (as we should for print/export fidelity) but consume the image as raster--PNG or SVM--needed to compose the document.

Believe the conversion happens on first filter import of the image, and there after we work with it as raster, including save and reopen of the ODT.

Personally I have no issue with the increased size as I am assured consistent quality of the raster. While repeatedly filter import of the SVG (or other vector format) images is expensive--and is error prone to the layout/layering of elements on the document.

Having the vector images available for higher resolution of export and printing alone remains reasonable.
Comment 5 Thomas Lendo 2018-04-03 19:55:45 UTC
odinatlas, do you have a statistics or file size comparison for some examples so that others can see what data saving we discuss here about?
Comment 6 odinatlas 2018-04-03 23:45:39 UTC
Created attachment 141068 [details]
Size_on_LO_5_229kb
Comment 7 odinatlas 2018-04-03 23:46:06 UTC
Created attachment 141069 [details]
Size_on_LO_6_810kb
Comment 8 Samuel Mehrbrodt (allotropia) 2018-04-04 06:05:22 UTC

*** This bug has been marked as a duplicate of bug 115005 ***
Comment 9 Samuel Mehrbrodt (allotropia) 2018-04-04 06:05:42 UTC
Solved with:

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1c1160967acf49cffae8921f3ab8361821bbaaaf

tdf#115005: New option to prevent adding fallback images
Comment 10 Tomaz Vajngerl 2018-04-04 09:50:22 UTC
Just to clarify - If a vector and raster graphic are available, we always import the vector graphic and ignore the raster graphic. The only time we would use the raster graphic is when the vector graphic is of an unknown type. 

I wonder what MSO does in this situation when loading a ODF file...
Comment 11 phv 2022-01-23 12:51:45 UTC
This option deserves to be easily accessible in the options (Load/Save -> General?), with the replacement set to on by default.

Turning off duplication of SVG images into PNG is the first thing I do on a new version of LibreOffice, mainly to prevent the bug #123396, but also because my documents contain many icons. Especially since I noticed that this conversion to PNG distorted the SVG icons (size not respected).
Comment 12 Tomaz Vajngerl 2022-01-23 13:45:59 UTC
Better not recycle this bug report... adding an option for the UI is a different thing so a new bug report is needed.