checking for errors

Post questions on how to use or achieve an effect in Inkscape.
Amadeus12
Posts: 66
Joined: Sat Sep 11, 2010 4:20 pm

checking for errors

Postby Amadeus12 » Tue Oct 05, 2010 5:59 pm

I regularly make some pictures for wikipedia. After I have made a picture, I post them on the site wikimedia commons and then I find out that something is wrong.

Is there a way to check out if there are any errors in the svg-file that I have made before I have posted it on the website wikimedia commons?
A program, a browser? E.g.: "if it doesn't look good with ...., then something is wrong."

Also, is it possible to edit the xml-file outside inkscape?

User avatar
shawnhcorey
Posts: 149
Joined: Mon Jan 07, 2008 12:17 pm

Re: checking for errors

Postby shawnhcorey » Thu Oct 07, 2010 11:14 pm

Amadeus12 wrote:Also, is it possible to edit the xml-file outside inkscape?


Yes.

There are a number of tools you can use to check the XML. There's xmllint(1) which, if you are running Linux, is already installed on your machine. There is also tidy which has an XML mode to check XML files.

Amadeus12
Posts: 66
Joined: Sat Sep 11, 2010 4:20 pm

Re: checking for errors

Postby Amadeus12 » Wed Oct 13, 2010 3:02 pm

I think this post can be worthwhile to other inkscape users. Therefore I post the answers of wikipedians on this forum:

I want to check the svg-files I make for wikimedia beforehand. The files that look good in inkscape suddenly show errors after having posted them. I already started a thread on the inkscape forum about it: [18], and the solution given was already familiar to me. SVG-files can be checked with a program like Bluefish (linux) but that doesn't suffice. An svg-file can apparently be well coded, yet still show errors on wikimedia. An example for this can be found here: [19] (look at the arrows). Maybe this is something for the tech people. Okay, let me hear what you think about it and if you are having similar problems on this issue. Citypeek (talk) 05:31, 10 October 2010 (UTC)

The renderer MediaWiki uses isn't perfect, but there's some basic steps you can take that solve many complications. The main two things: convert everything (like arrows) to paths and save as "Plain SVG", not the default "Inkscape SVG. This is a common issue so there's lots of help out there. Here are some useful links: Commons:Graphics village pump (although posting here is ok too), Help:SVG, Help:Inkscape, w:Wikipedia:Graphic Lab/Resources/SVG, COM:EIC#Ink. I'm unaware of any software that can give you a preview of what it will look like before uploading (but I use Windows; I think there's stuff out there for Linux). Rocket000 (talk) 07:24, 10 October 2010 (UTC).

You can upload the images over this file: File:Test.svg This file is used just for testing svg files. Amada44 talk to me 08:08, 10 October 2010 (UTC)

Thanks for answering, Rocket000 and Amada44. These were excellent answers. Answers I can work with. Citypeek (talk) 08:24, 10 October 2010 (UTC)

If you have Linux, you can use rsvg-view to preview how the file will display (MediaWiki uses rsvg to render SVG files). Pruneautalk 09:06, 10 October 2010 (UTC)

Or Windows, if you set it up right. Jarry1250 (talk) 21:54, 10 October 2010 (UTC)

An SVG file will almost certainly have major problems if it includes any of the following constructs which Inkscape seems to insert fairly regularly:

1. An attempt to link to an external raster image by means of an <image tag.
2. "Flowtext" tags (i.e. flowpara, flowspan, etc.)
3. Inserting &quot; in an internal link (i.e. ="url(&quot;#anchor&quot;)" instead of ="url(#anchor)")

I must have fixed and reuploaded well over a hundred SVG files due to just the first problem alone... AnonMoos (talk) 14:54, 10 October 2010 (UTC)

Additionally RSVGLIB does not recognise some CSS constructions (thankfully(?), SVG editor's bloat their code by not including this sort of optimisation). Jarry1250 (talk) 21:54, 10 October 2010 (UTC)

One quick way to check an SVG locally is to drag the file into either Firefox or Opera. -84user (talk) 22:29, 10 October 2010 (UTC)

Sure. Looking good there is a first step. The main problem is about the svg renderer used by Commons which is very different from the renderer in Firefox. I test svgs usually also in my image viewer gThumb (Linux). Cheers --Saibo (Δ) 23:46, 10 October 2010 (UTC)
Testing it in your browser won't show you what the PNG MediaWiki will create looks like. Rocket000 (talk) 20:42, 11 October 2010 (UTC)

I'm working on a Toolserver tool to ease these issues, but no guarantees. Jarry1250 (talk) 21:48, 11 October 2010 (UTC)

That would be awesome. One of the changes in the new upload system as part of the Usability Initiative will have users upload before filling out the information. One of the reasons listed is that it will give a preview of the file. Rocket000 (talk) 22:57, 11 October 2010 (UTC)


Return to “Help with using Inkscape”