SVG export: try to reuse original bitmap data for JPG and PNG bitmaps

Desktop / LibreOffice - Miklos Vajna [collabora.com] - 25 February 2020 15:20 EST

This has a number of benefits:

1) For a sample JPG photo, the SVG output is now 4,9MB, not 20MB.

2) Even the first export to SVG is fast, see commit 570be56b37e4ff105649e604ff4c8a6c368e2e79 (svx: cache PNG export of graphic shapes, 2020-02-25) for exact numbers.

3) Allow using less memory as the SdrGrafObj doesn't have to store a PNG result till the document is closed.

We still require matching checksums, so in case anything problematic happens with the bitmap (grayscale filter applied, etc), then the optimization is meant to not help, but still produces correct output.

Change-Id: Id3bc359a8dcc4c4d12d3b66ffb512cfa71939a26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89419

c7af36a6504a SVG export: try to reuse original bitmap data for JPG and PNG bitmaps
filter/source/svg/svgwriter.cxx | 45 +++++++++++++++++++++++++++++++----------
include/svx/svdograf.hxx | 9 ---------
svx/source/svdraw/svdograf.cxx | 22 --------------------
3 files changed, 34 insertions(+), 42 deletions(-)

Upstream: cgit.freedesktop.org


  • Share