Create account / Log in

SVG map import fails - What am I doing wrong?

Issues with the Vassal engine.

Moderators: uckelman, Tim M

SVG map import fails - What am I doing wrong?

Postby blackice » October 4th, 2013, 5:41 am

Hello!

Having spent days re-creating a map by hand as .svg in Inkscape, I wanted to import it into my module tonight. However, on attempting to load it I get the "Unable to Read File - VASSAL was unable to read the file '[file name]'" error message.

I have tried simpler versions of the same map, e.g. by collapsing everything onto one layer and removing the only .svg component that I had not created myself. The only time I managed an import was when I stripped out everything except for the most basic shapes.

Here are the basic stats for what I am trying to import

  • Mostly hand drawn .svg file created in Inkscape
  • 10.6 MB file size
  • 4,000 x 4,400 pixel nominal size
  • About 5,000 total shapes
  • Tried loading with original eight layers as well as collapsed to single layer
  • No embedded bitmaps or code
  • Running VASSAL 3.2.8 on Mac OS X 10.7.5 with Java 1.6.0_51 from Apple
It seemed like this should be straightforward, but it is not (for me). I have considered breaking the map into smaller chunks, but this would be quite tedious in the .svg format.

Please help me figure out how to make this work – and what additional information you need to be able to help.

It would be such a shame to export the map to PNG first. Thanks a bunch for an assistance in advance!

– Martin
User avatar
blackice
 
Posts: 41
Joined: August 13th, 2010, 7:21 pm
Location: Vancouver, BC, Canada

Re: SVG map import fails - What am I doing wrong?

Postby uckelman » October 4th, 2013, 8:54 am

Thus spake blackice:
> Hello!
>
> Having spent days re-creating a map by hand as .svg in Inkscape, I
> wanted to import it into my module tonight. However, on attempting to
> load it I get the "Unable to Read File - VASSAL was unable to read the
> file '[file name]'" error message.
>
> I have tried simpler versions of the same map, e.g. by collapsing
> everything onto one layer and removing the only .svg component that I
> had not created myself. The only time I managed an import was when I
> stripped out everything except for the most basic shapes.
>
> Here are the basic stats for what I am trying to import
>
>
> * Mostly hand drawn .svg file created in Inkscape
> * 10.6 MB file size
> * 4,000 x 4,400 pixel nominal size
> * About 5,000 total shapes
> * Tried loading with original eight layers as well as collapsed to
> single layer
> * No embedded bitmaps or code
> * Running VASSAL 3.2.8 on Mac OS X 10.7.5 with Java 1.6.0_51 from
> Apple
>
>
>
> It seemed like this should be straightforward, but it is not (for me). I
> have considered breaking the map into smaller chunks, but this would be
> quite tedious in the .svg format.
>
> Please help me figure out how to make this work – and what additional
> information you need to be able to help.
>
> It would be such a shame to export the map to PNG first. Thanks a bunch
> for an assistance in advance!
>

Where can we get the SVG so we can try it ourselves?

--
J.
User avatar
uckelman
Site Admin
 
Posts: 8849
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: SVG map import fails - What am I doing wrong?

Postby blackice » October 4th, 2013, 2:32 pm

Hi Joel,

The map file is here: https://www.dropbox.com/s/s1lwbqfo2nlsp ... shrunk.svg

Can you get it this way? Thanks for your help!

– Martin
User avatar
blackice
 
Posts: 41
Joined: August 13th, 2010, 7:21 pm
Location: Vancouver, BC, Canada

Re: SVG map import fails - What am I doing wrong?

Postby uckelman » October 22nd, 2013, 10:14 pm

Thus spake blackice:
> Hi Joel,
>
> The map file is here: https://www.dropbox.com/s/s1lwbqfo2nlsp ...
> shrunk.svg[1]
>
> Can you get it this way? Thanks for your help!
>

Did you check VASSAL's errorLog? It says what the problem is:

"Caused by: org.w3c.dom.DOMException: The current document is unable to create an element of the requested type (namespace: http://www.w3.org/2000/svg, name: flowRoot)."

Your SVG contains flowRoot elements, but the version attribute of the
svg element is set to 1.1. The flowRoot element wasn't part of the SVG
1.1 standard. If you want to use flowRoot, you have to use SVG 1.2.
You could simply edit the svg element so that version="1.2", but that
won't be enough to get this file to work. When I tried that, there
were some other problems:

'The "center" identifier is not a valid value for the "text-align"
property.'

So, you have some problems with your SVG.

--
J.
User avatar
uckelman
Site Admin
 
Posts: 8849
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: SVG map import fails - What am I doing wrong?

Postby blackice » October 26th, 2013, 3:22 am

Hi Joel,

Great, thanks for figuring this out. I feel like such an amateur, but I will find a way to make this work.

Cheers,

Martin
User avatar
blackice
 
Posts: 41
Joined: August 13th, 2010, 7:21 pm
Location: Vancouver, BC, Canada

Re: SVG map import fails - What am I doing wrong?

Postby blackice » October 26th, 2013, 4:44 pm

Hi,

I managed to get rid of all flowRoot elements. This article was tremendously helpful for the task: http://www.inkscapeforum.com/viewtopic.php?f=5&t=10819

However, I am now running into the next error message. At least this time I found it and I believe it means that I have a special character issue:

Code: Select all
Caused by: java.io.UTFDataFormatException: Invalid byte 1 of 1-byte UTF-8 sequence.


The map is using two Scandinavian characters, which I suspect cause the problem: ø and å.

I will try again with those characters removed, but do you have any thoughts on how to get them to work?

Thanks!

Martin
User avatar
blackice
 
Posts: 41
Joined: August 13th, 2010, 7:21 pm
Location: Vancouver, BC, Canada

Re: SVG map import fails - What am I doing wrong?

Postby blackice » October 26th, 2013, 8:39 pm

Great, the map is now loaded! I am still missing the Scandinavian characters, so any thoughts on those are still very welcome.

– Martin
User avatar
blackice
 
Posts: 41
Joined: August 13th, 2010, 7:21 pm
Location: Vancouver, BC, Canada

Re: SVG map import fails - What am I doing wrong?

Postby uckelman » October 26th, 2013, 8:41 pm

Thus spake blackice:
> Hi,
>
> I managed to get rid of all flowRoot elements. This article was
> tremendously helpful for the task:
> http://www.inkscapeforum.com/viewtopic.php?f=5&t=10819[1]
>
> However, I am now running into the next error message. At least this
> time I found it and I believe it means that I have a special character
> issue:
>

> Code:
> Caused by: java.io.UTFDataFormatException: Invalid byte 1 of 1-byte
> UTF-8 sequence.
>
>
>
> The map is using two Scandinavian characters, which I suspect cause the
> problem: __ø__ and __å__.

Neither of these are single-byte characters in UTF-8, so if they're
encoded a single bytes, they're encoded improperly.

Can I see the SVG you have now?

--
J.
User avatar
uckelman
Site Admin
 
Posts: 8849
Joined: December 10th, 2007, 9:48 am
Location: Durham, England


Return to Technical Support & Bugs

Who is online

Users browsing this forum: No registered users and 6 guests