Apache OpenOffice (AOO) Bugzilla – Issue 121128
"Save Graphics..." exports SVG as hex-encoded PNG image
Last modified: 2013-07-12 16:25:07 UTC
Created attachment 79660 [details] Writer document with an SVG graphic embedded * Insert an SVG image in Writer * Select the graphic * Right click to open the context menu * Select the context menu item “Save Graphics...” * On the Save dialog, select the “SVG – Scalable Vector Graphics” filter, enter a file name, and save the graphic * Open the exported SVG graphic with a text editor: you'll see that the image was exported as an embedded, base 64 encoded, PNG image inside the SVG file <image xlink:href="data:image/png;base64,[IMAGE DATA]"/> Exporting using AOO API works ok
Created attachment 79661 [details] Original SVG image, embedded in Writer
Created attachment 79662 [details] Exported SVG graphic The original SVG image is exported as an hex-encoded PNG image embedded in the SVG file
ALG: Indeed, the image gets converted to bitmap content and then exported as SVG cotaining a big base64-encoded bitmap. Taking a look...
ALG: Same mechanism works in draw/impress. No context menu to export inserted graphic in SC.
@Armin: some code I've found: - void SwGrfShell::Execute(SfxRequest &rReq) in main/sw/source/ui/shells/grfsh.cxx calls ExportGraphic( *pGraphic, sGrfNm ); - ExportGraphic in main/sw/source/ui/docvw/romenu.cxx call XOutBitmap::WriteGraphic - XOutBitmap::WriteGraphic in main/svx/source/xoutdev/_xoutbmp.cxx does it handle SVG source graphics?
ALG: Thanks Ariel, I'm on it. I already got SwGrfShell::Execute and I'm compiling SW with debug (let's see if I will be able to link it , though :-)). Other fingings show that SW does it it's own way, a way where saving is not yet implemented to take shortcuts if possible (if target format is original format...).
ALG: Added missing original data export for SVG in XOutBitmap::WriteGraphic, committed as revision 1391088.
Verified on Aoo_Trunk_20121109.1800 rev 1407366 pass
close it.