[Libreoffice-bugs] [Bug 96892] Low precision in PDF export of SVG images leads to visible artifacts at high zoom levels

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Sat Dec 2 13:19:25 UTC 2017


https://bugs.documentfoundation.org/show_bug.cgi?id=96892

--- Comment #13 from Kai Struck <struckkai at gmx.net> ---
(In reply to Martin from comment #5)
> Thank you for the files, Julien.
> 
> Long story short (see the next post for details), your files eventually led
> me to what I think is a bug in appendFixedInt() in
> core/vcl/source/gdi/pdfwriter_impl.cxx :
> 
> 
>     sal_Int32 nFactor = 1, nDiv = nPrecision;
>     while( nDiv-- )
>         nFactor *= 10;
> 
>     sal_Int32 nInt      = nValue / nFactor;
>     rBuffer.append( nInt );
>     if( nFactor > 1 )
>     {
>         sal_Int32 nDecimal  = nValue % nFactor;
>         if( nDecimal )
>         {
>             rBuffer.append( '.' );
>             // omit trailing zeros
>             while( (nDecimal % 10) == 0 )
>                 nDecimal /= 10;
>             rBuffer.append( nDecimal );
>         }
>     }
> 
> 
> The problem with this code is that e.g. for nValue = 105, nPrecision = 2 it
> gives nDecimal = 5, so it outputs "1.5" rather than the correct "1.05"!

I think this nailed it. The code should append 05 but of course only appends 5.
Meanwhile the code has been simplified to only support 1 decimal according to:
http://opengrok.libreoffice.org/

It's a pity because this prevents LO to export fine detailed Vector-PDFS. I
attached a testfile.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20171202/32dfaff4/attachment.html>


More information about the Libreoffice-bugs mailing list