Inkscape not saving editing svg properly

Bug #1265637 reported by Paul wallace
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Inkscape
New
Low
Unassigned

Bug Description

This is a little tricky to explain, today I edited a vector graphic whose Colour was originally a blue, it had three layers the second, middle being the Colour, I changed that- saved as and it seemed to work great, but when I tried to use that graphic elsewhere the programs started to show it as the original blue colour again, I re-saved it many times all as different names and in different directories, I asked someone to try export it in Illustrator as I did not have it installed and wholla, the file suddenly showed red everywhere like it should have, funny thing is that Internet explorer and Inkscape showed the broken file as red like it should have being.

Sorry if I did not explain it very well, I have some screenshots to better explain what I mean.

Exported with Inkscape, (should have shown red and nothing else):
http://static.dyp.im/7oeMNgLc4t/6283c662cb746ab26e54e327baa26e06.jpg

Files with the blue icons at the bottom of the list (still should have being red, exported with Inkscape)
http://static.dyp.im/rfW5QcEzFu/d7ca8b8a5c3bb224821194bd5ce24b99.png

Now the same file exported again from Illustrator:
http://static.dyp.im/Pqvv9ZGX75/ee3ea07f7f98b36f7c395225d3c186a4.png

See the bottom in the list red.svg is now showing perfectly fine

This isn't a bug in the program in those screenshots, I'm an Application developer and my Application would show all the files exported from Inkscape as Blue, but from Illustrator they are completely fine and showing perfectly.

Here are the two files, one from Inkscape and once from Illustrator:

http://www.allstarsoftware.x10.mx/Vector_images_inkscape_illustrator.rar

I am using 64bit windows 8.1 with Inkscape 0.48.4 r9939 as well.

Tags: color
Revision history for this message
Paul wallace (allstar12345) wrote :

I have found that saving the SVG in Inkscape as a "Optimized SVG" with unticking the "Simplifying colors" check box seems to rectify the issue, I can confirm the outputted SVG files work as they should with those settings.

jazzynico (jazzynico)
tags: added: color
Revision history for this message
jazzynico (jazzynico) wrote :

Not reproduced on Crunchbang Waldorf (a Debian stable based distro.), with Inkscape, Batik (squiggle) and the Thunar file manager. They all show a red shape.

But the affected path shows two concurrent attributes to describe its fill color:

  <path
     d="M30,53.999C12.056,53.999,6,47.943,6,30C6,12.056,12.056,6,30,6c17.943,0,24,6.056,24,24 C54,47.943,47.943,53.999,30,53.999z"
     id="path13"
     fill="#1080DD"
     style="fill:#ff2a2a" />

Modifying the color in Inkscape changes the style, but not the fill attribute. Depending on the precedence used by your application, you can have a blue or red shape. I haven't checked the specifications yet, but I'd tend to consider Batik as very accurate. To be confirmed.
IMHO, Inkscape should get rid of the old fill attribute as soon as the color is changed anyway.

Another workaround: remove the fill="#1080DD" line in the SVG file with a text editor or the embedded XML editor.

Changed in inkscape:
importance: Undecided → Low
Revision history for this message
su_v (suv-lp) wrote :

<quote>
For user agents that support CSS, the presentation attributes must be translated to corresponding CSS style rules according to rules described in Precedence of non-CSS presentational hints ([CSS2], section 6.4.4), with the additional clarification that the presentation attributes are conceptually inserted into a new author style sheet which is the first in the author style sheet collection. The presentation attributes thus will participate in the CSS2 cascade as if they were replaced by corresponding CSS style rules placed at the start of the author style sheet with a specificity of zero. In general, this means that the presentation attributes have lower priority than other CSS style rules specified in author style sheets or ‘style’ attributes.

User agents that do not support CSS must ignore any CSS style rules defined in CSS style sheets and ‘style’ attributes. In this case, the CSS cascade does not apply. (Inheritance of properties, however, does apply. See Property inheritance.)
</quote>
<http://www.w3.org/TR/SVG11/styling.html#UsingPresentationAttributes>

Revision history for this message
su_v (suv-lp) wrote :

Related issue (when modifying the color of gradient stops):
- Bug #1075325 “inkscape does not remove stop-color attribute from lineargradient tag when modified”
  <https://bugs.launchpad.net/inkscape/+bug/1075325>

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.