Import SVG Artwork

Talk about map artwork, share links to artwork (including symbols you made). Please DO NOT link to downloads or sites that are breaking someone's copyrights.

Moderator: Kyete

Post Reply
User avatar
Balmung
Posts: 211
Joined: Sun Mar 28, 2021 2:12 pm
Location: Germany

Import SVG Artwork

Post by Balmung » Thu Apr 01, 2021 9:22 pm

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?
Attachments
compass.PNG
compass.PNG (201.06 KiB) Viewed 6925 times
System information:
  • Windows 10 Professional x64
  • AMD Ryzen 5 3600XT
  • 32GB DDR4 RAM
  • Nvidia GeForce 3070 FE

User avatar
SilverSurfer1221
Posts: 88
Joined: Sat Jun 20, 2020 2:01 pm

Re: Import SVG Artwork

Post by SilverSurfer1221 » Thu Apr 01, 2021 9:54 pm

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)?

User avatar
Balmung
Posts: 211
Joined: Sun Mar 28, 2021 2:12 pm
Location: Germany

Re: Import SVG Artwork

Post by Balmung » Thu Apr 01, 2021 10:16 pm

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 ^^
System information:
  • Windows 10 Professional x64
  • AMD Ryzen 5 3600XT
  • 32GB DDR4 RAM
  • Nvidia GeForce 3070 FE

User avatar
SilverSurfer1221
Posts: 88
Joined: Sat Jun 20, 2020 2:01 pm

Re: Import SVG Artwork

Post by SilverSurfer1221 » Thu Apr 01, 2021 11:01 pm

Just wanted to check. Can you share the file?

User avatar
Balmung
Posts: 211
Joined: Sun Mar 28, 2021 2:12 pm
Location: Germany

Re: Import SVG Artwork

Post by Balmung » Thu Apr 01, 2021 11:12 pm

Here's a file were this also happens.
Attachments
test.zip
(790 Bytes) Downloaded 284 times
System information:
  • Windows 10 Professional x64
  • AMD Ryzen 5 3600XT
  • 32GB DDR4 RAM
  • Nvidia GeForce 3070 FE

User avatar
SilverSurfer1221
Posts: 88
Joined: Sat Jun 20, 2020 2:01 pm

Re: Import SVG Artwork

Post by SilverSurfer1221 » Thu Apr 01, 2021 11:35 pm

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.

User avatar
Kanchou
Site Admin
Posts: 1021
Joined: Mon Nov 10, 2014 2:23 pm

Re: Import SVG Artwork

Post by Kanchou » Thu Apr 01, 2021 11:37 pm

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
Alejandro S. Canosa
Three Minds Software

User avatar
Kanchou
Site Admin
Posts: 1021
Joined: Mon Nov 10, 2014 2:23 pm

Re: Import SVG Artwork

Post by Kanchou » Fri Apr 02, 2021 12:06 am

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 6911 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
Alejandro S. Canosa
Three Minds Software

User avatar
Balmung
Posts: 211
Joined: Sun Mar 28, 2021 2:12 pm
Location: Germany

Re: Import SVG Artwork

Post by Balmung » 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 :)
System information:
  • Windows 10 Professional x64
  • AMD Ryzen 5 3600XT
  • 32GB DDR4 RAM
  • Nvidia GeForce 3070 FE

User avatar
Kanchou
Site Admin
Posts: 1021
Joined: Mon Nov 10, 2014 2:23 pm

Re: Import SVG Artwork

Post by Kanchou » Fri Apr 02, 2021 11:20 am

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
Alejandro S. Canosa
Three Minds Software

Post Reply