tisn05 / sk1

Automatically exported from code.google.com/p/sk1
Other
0 stars 0 forks source link

bad conversion from SVG #25

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. uniconvertor d3.svg d3.wmf
2. uniconvertor d3.svg d3.1.pdf

What is the expected output? What do you see instead?
I expect a wmf and pdf file of roughly the same dimensions and appearance as 
the svg file.
The wmf file is completely wrong (very wrong dimensions; because the width 
becomes so small, the contents are inscrutable), and the pdf file is slightly 
wrong (the fonts are wrong, one of the lines goes way off the page).

Also got a warning:

/usr/local/lib/python2.6/dist-packages/sk1libs/filters/export/wmfsaver.py:377: 
DeprecationWarning: integer argument expected, got float
  checksum)

What version of the product are you using? On what operating system?

UniConvertor 1.1.5
Debian Squeeze on i386

Please provide any additional information below.

This doesn't happen to me with all SVGs.  I created this SVG by creating a 
LaTeX document with pgfplots and using pdflatex to obtain a PDF file (d3.pdf), 
and then used inkscape to convert the PDF file into a plain SVG file.  I am 
able to read the PDF file correctly with any poppler-based PDF viewer (evince, 
zathura), and the SVG file looks OK with inkscape, gimp, epiphany-webkit, 
chromium, and display (ImageMagick).

Input and output files attached.  d3.pdf is the original image, d3.svg is the 
source image used with UniConvertor, d3.wmf and d3.1.pdf were produced by 
UniConvertor.

Original issue reported on code.google.com by Li.Any...@gmail.com on 18 Mar 2011 at 5:33

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for reported issue. This will help improving SVG and WMF filters.

Original comment by Igor.E.N...@gmail.com on 18 Mar 2011 at 10:16

GoogleCodeExporter commented 8 years ago
I did a little debugging for myself and I think the problem is the SVG loader 
not handling clipping.  Without clipping there are some points with rather 
large negative y values, which probably explains the line going way off the 
page in the PDF.  I believe the warning about the float is because "inch" gets 
rescaled in SaveDocument in wmfsaver.py to 32767/max(width,height), where width 
and height are floats.  Basically everything ends up lost in the WMF because 
the WMF is rescaled instead of cropped.  

Original comment by Li.Any...@gmail.com on 29 Jun 2011 at 7:12