Creating content for thenounproject, my SVG files behave bad

Using Inkscape with other software? Talk about it here.
jmkeuning
Posts: 15
Joined: Sun Nov 11, 2012 2:22 am

Creating content for thenounproject, my SVG files behave bad

Postby jmkeuning » Fri Dec 07, 2012 11:54 am

I am sorry that this is not a pure inkscape question, because it has to do with finishing SVG files and loading them to the noun project.

I create a 100px x 100px SVG and when I upload the file it does not display correctly. I cannot figure out what I have wrong and I cannot figure out who to ask.

You can see the items I have created here: http://thenounproject.com/jmkeuning/#

Here is a screen shot of some:

Image

Only the boat is correct. The others are shifted to the top left.

If you click on my bouy and compare it to the other on the bouy page:

Image

When you compare it to the other bouy in the full size display it is smaller.

Image

Anyone have any thoughts on this? Other than the 100 x 100 constraint I do not know what to change.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Creating content for thenounproject, my SVG files behave

Postby brynn » Sat Dec 08, 2012 1:22 pm

What an interesting project!

Do you have the images fully within the page border, when you save SVG in Inkscape? Are all the images shifted by the same amount each time? If so, that could be a clue.

I looked at the page source, mostly out of curiosity. I don't really know enough abouit XML. But someone who does might be able to spot a clue.

jmkeuning
Posts: 15
Joined: Sun Nov 11, 2012 2:22 am

Re: Creating content for thenounproject, my SVG files behave

Postby jmkeuning » Sat Dec 08, 2012 2:10 pm

Yes, I set the document size to 100 x 100 and then I put my image inside the border. It looks like they are all shifted about the same.

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: Creating content for thenounproject, my SVG files behave

Postby druban » Sat Dec 08, 2012 4:05 pm

Hi james, or is it Joe? I am not an SVG expert, but since response is slow for your problem here's my 25.
The one file that you said was not problematic was the boat. I downloaded it and two other samples. The boat was the only one without a transform attribute and a group or layer.
I have removed the unnecessary group or layer (same thing in Inkscape, in case you did not know) and with it the transform. Those files are the same title as before.... I also removed some unnecessary cruft in the styles and changed the safe to a single path to match the others. I hope they display as you want them to now.
One of the options when you are putting things on the internet is to save it as 'plain SVG'. This removes all the Inkscape specific stuff like grids etc. that you use when you draw but no one else needs to have and may make it difficult for some other editors to edit. Also the file is a bit smaller and for files as small as yours this may be significant.... Anyway those are the files with '_plain' appended.
Please note! Simply re-saving a file as plain SVG will NOT fix the rogue transform attribute!

Let me know if the problem is resolved for these two files when you upload them!
Attachments
Nounprojectfixedfiles.zip
(12.17 KiB) Downloaded 279 times
Your mind is what you think it is.

jmkeuning
Posts: 15
Joined: Sun Nov 11, 2012 2:22 am

Re: Creating content for thenounproject, my SVG files behave

Postby jmkeuning » Mon Dec 10, 2012 7:30 am

Thanks for the help on this. (It's James, thanks for asking.)

I appreciate the time you put into this. Unfortunately, your ideas did not solve the problem. The files you fixed display the same way... so that is not solving the problem. Here is a comparison screen shot, first a simple USA map that I made, and then your "noun_project_7362_plain.svg" - you can see that the map is centered in the box, the safe is not. I have determined that this tells me is the uploaded file will display correctly.

I am not familiar with stripping out the groups and transform attributes, but I appreciate you bringing that to light so I can do some more learning!

Image Image

jmkeuning
Posts: 15
Joined: Sun Nov 11, 2012 2:22 am

Re: Creating content for thenounproject, my SVG files behave

Postby jmkeuning » Wed Dec 19, 2012 8:53 am

I am fairly certain that the problem has to do with the Transform Attribute. Does anyone know where I can read about the Transform Attribute and how it might be causing this problem - or more specifically, what I can do to fix it?

How necessary it the Transform Attribute and how can I strip it out?

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: Creating content for thenounproject, my SVG files behave

Postby druban » Wed Dec 19, 2012 1:10 pm

For drawings as simple as yours transform attributes, groups and layers are only hindrances. Remove your transform attribute by ungrouping groups, and if you have layers, copying everything, deleting the layer and then doing a 'paste in place'.
Now all your objects are in the 'root' i.e. not in any group or layer. The final step (necessary sometimes if you still see a transform attribute in the xml) is to move everything a little bit and move it back (use opposing arrow keys for an exact return...)
...but note that this is what I did for you before but you said it made no difference then! It would be interesting if it works when you do it.
Your mind is what you think it is.

jmkeuning
Posts: 15
Joined: Sun Nov 11, 2012 2:22 am

Re: Creating content for thenounproject, my SVG files behave

Postby jmkeuning » Thu Dec 20, 2012 2:34 am

Number one: I have concluded that the Transform is not the problem. So table that.

Number two: I created a simple SVG, created a object and saved. No Transform attribute. I opened the file, change the document to 100px x 100px, changed the object to path and saved. Now I have the transform attribute. As far as I know, there are no groups or layers. I tried to open, move back and forth, and save, and the transform attribute persists.

As I said, this is not what is causing the problem, but now I am curious.

Here is what I discovered - if I start the project with a document that is bigger than 100px x 100px (the size required for nounproject submission) and then resize after some drawing, I get the display issue. If I start with a blank 100 x 100 document and draw in that document, no issue. So I can fix all my problems by using a blank template, pasting the problem designs into the blank working template, are saving over the original.

If you want to help me understand the transform attribute, that's cool, but as I said, it is not causing the problem and while I have not figured out the problem I have a workaround.

Thanks!
Attachments
transform test.svg
(1.78 KiB) Downloaded 255 times

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Creating content for thenounproject, my SVG files behave

Postby brynn » Thu Dec 20, 2012 11:55 am

Well, I can tell you that there are some bugs related to the transform attribute. Some of the bugs are related to how Inkscape reacts to the transform attribute (whether appropriately or inappropriately created), and other bugs are related to the inappropriate creation of a transform attribute in the first place. The attribute itself apparently shows up if you change the page size and/or orientation. (I don't know if that's approriate or not.) It may show up at other times too, and if so, I'm not sure what those are. I also know that you can avoid bugs related to that attribute by creating a new layer, after changing the page size and/or orientation, and drawing on that layer. (Of course that doens't avoid the bugs for objects drawn in previously existing layers, and/or such objects that are moved into new layers....and/or other things that may cause the appropriate or inappropriate creation of a transform attribute.)

There's a member here who knows probably everything there is to know about the transform attribute bugs, but who hasn't been around for the last couple of months (~suv). You might be able to find her on the IRC channel.

Short of that, you can probably search Launchpad using "transform attribute" and at least by able to read through all the bugs. https://launchpad.net/inkscape and http://inkscape.org/discussion.php?lang=en
Last edited by brynn on Thu Dec 20, 2012 2:12 pm, edited 1 time in total.
Reason: removed some unnecessary comments


Return to “Inkscape & other”