#tdf51510: Change the DPI to get better resolution, but failed the unit test

Lodev lodev at ossii.com.tw
Thu Aug 10 14:32:58 UTC 2023


Hi,


We're trying to fix #tdf51510: "Exporting documents with embedded SVG to 
doc or docx converts the image to low-resolution pixel graphics" since 
it bothers us and it seems more and more bugs duplicated or related to 
this one.  We changed in vcl/source/gdi/vectorgraphicdata.cxx:78

-            Size 
aDPI(Application::GetDefaultDevice()->LogicToPixel(Size(1, 1), 
MapMode(MapUnit::MapInch)));
+            Size 
aDPI(Application::GetDefaultDevice()->LogicToPixel(Size(50, 50), 
MapMode(MapUnit::MapInch)));

To get better resolutions.  It worked.  Exported docx file with embedded 
png now gets better resolution.

However this change couldn't pass unit test : 
sw/qa/extras/ooxmlexport/ooxmlexport16.cxx:762, tdf136841.docx . It 
seems to be fixed, expecting low resolution converted images.

Since it didn't pass the unit test, we didn't commit the patch to 
gerrit.  So here, first we'd like to know if this solution, changing 
size(1,1) to size(50,50) is acceptable or not?

If not, is there any better suggestion to solve this?

If yes, how can we pass the unit test given that patch?

Thanks for your suggestion.


Dev



More information about the LibreOffice mailing list