https://bugs.documentfoundation.org/show_bug.cgi?id=162309
Bug ID: 162309
Summary: Wrong page and shape sizes when importing SVG
Product: LibreOffice
Version: unspecified
Hardware: All
OS: All
Status: UNCONFIRMED
Keywords: filter:svg
Severity: normal
Priority: medium
Component: Draw
Assignee: [email protected]
Reporter: [email protected]
Created attachment 195658
--> https://bugs.documentfoundation.org/attachment.cgi?id=195658&action=edit
A rectangle 1 by 2 mm
The attachment is as simple as:
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.2" width="1mm" height="2mm" viewBox="0 0 1 2"
xmlns="http://www.w3.org/2000/svg">
<g>
<rect x="0" y="0" width="1" height="2"/>
</g>
</svg>
It is a file with viewBox of 1x2 from [0, 0]; the user units of mm; and a
single rectangle 1x2 from [0, 0] (so covering 100% of the viewBox).
It is expected, that importing this, Draw would use the document information to
construct its document model (as always should be done with any document we
import: we take page size from DOCX, XLS, ... - whenever that info is there).
Here, the document dictates the page size clearly - it must be 1 x 2 mm; and
the rectangle on it must be 1 x 2 mm, positioned at point [0, 0].
In reality, the page is 1.26 x 2.26 mm; the rectangle is 0.98 x 1.98 mm (which
is intolerable in this specific case, where both SVG uses mm, and Draw's
internal units are mm/100, so must result in exact whole numbers); and the
position of the rectangle is [0.06 mm, 0.06 mm].
This is not just a curious non-issue. Take any SVG having a clear definition of
their box; and convert-to a raster image. The end result will always have one
too many pixels on X and Y, and the object boundaries aligned to SVG units will
all be in the middle of resulting pixels, creating blurry edges. Doing this
with this attachment would not create a proper totally black image with
proportions 1 : 2, but a 5x9 bitmap with unexpected white and grey borders.
--
You are receiving this mail because:
You are the assignee for the bug.