Page 1 of 1

Import SVG Artwork

Posted: Thu Apr 01, 2021 9:22 pm
by Balmung
I made a compass rose. The source is a square svg, without any margins. After the import to OWM the image is placed in the upper right corner.

How do I prevent this?

Re: Import SVG Artwork

Posted: Thu Apr 01, 2021 9:54 pm
by SilverSurfer1221
Is it OWM? Or is it your SVG file that is causing the issue? What program did you make the SVG file in? Is the "document" (where the compass was made) a square with the compass in the upper-left corner (for example)?

Re: Import SVG Artwork

Posted: Thu Apr 01, 2021 10:16 pm
by Balmung
I used Inkscape and saved the image as "normal svg". In Inkscape it's a square with no spacing to the sides, that's why I'm confused ^^

Re: Import SVG Artwork

Posted: Thu Apr 01, 2021 11:01 pm
by SilverSurfer1221
Just wanted to check. Can you share the file?

Re: Import SVG Artwork

Posted: Thu Apr 01, 2021 11:12 pm
by Balmung
Here's a file were this also happens.

Re: Import SVG Artwork

Posted: Thu Apr 01, 2021 11:35 pm
by SilverSurfer1221
Thanks.

I can confirm - the SVG file opens perfectly in Affinity Designer, but imports into OWM at the upper-left of a much larger square, despite the created image being centered in a square barely larger than what was created. I've not worked with SVG files in OWM yet, but this happens to one I created on my end, too.

Re: Import SVG Artwork

Posted: Thu Apr 01, 2021 11:37 pm
by Kanchou
We'll investigate/fix with V1.0.4.

The parser we wrote for SVG is a bit old now, so there must be something we missed.

Thank you for the sample!

- Alejandro

Re: Import SVG Artwork

Posted: Fri Apr 02, 2021 12:06 am
by Kanchou
Took a quick look, it looks like the SVG attached defines a document area that is larger than the paths in it.
SVG.png
SVG.png (7.77 KiB) Viewed 7376 times
You can see it in the file (in mm instead of pxs, so that's about 330x330 pixels).

width="98.84073639mm"
height="97.72373962mm"
viewBox="0 0 98.84073639 97.72373962"

If you change the units to pixels instead of mm for the width and height it fixes the issue (you can just edit via notepad). Not sure why those are in mm in the file.

(EDIT: If you change via Inkscape then you'd have to scale the document/drawing size not just change the units).

I'll investigate more, but I'm thinking OWM is not at fault with this? Technically we could change the code to determine the boundaries of the paths/shapes in the document, but if I recall correctly that wasn't compatible with some files.


Thank you!

- Alejandro

Re: Import SVG Artwork

Posted: Fri Apr 02, 2021 4:18 am
by Balmung
The compass rose is from a map I started in Inkscape. Instead of copy it to a new file, I deleted everythin else. That's why those settings are in mm and far from default ^^

It worked now. Thank you :)

Re: Import SVG Artwork

Posted: Fri Apr 02, 2021 11:20 am
by Kanchou
Balmung wrote:
Fri Apr 02, 2021 4:18 am
The compass rose is from a map I started in Inkscape. Instead of copy it to a new file, I deleted everythin else. That's why those settings are in mm and far from default ^^

It worked now. Thank you :)
I'm glad that worked!

We'll still investigate using the "viewbox" as the width/height. I'm trying to remember if there was a reason we didn't :?

- Alejandro