Optimize SVG deletes fill="freeze" attribute for SMIL animation

Bug #1638040 reported by Jehan
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
New
Undecided
Unassigned
Scour
New
Undecided
Unassigned

Bug Description

I export a SVG as "Optimized SVG" and I realized that several frames were wrong. Objects which were supposed to disappear or appear fail to do so. It seems the "Optimized SVG" deletes the "fill" attribute on <animate*> tags (well actually not completely, a few survived, I can't see a pattern of when it is removed or not).

This is especially annoying because "remove" is the default value for the `fill` attribute (see: https://www.w3.org/TR/SVG11/single-page.html#animate-TimingAttributes) so when you delete it, you can completely break a file when it depended on the animation result being frozen.

I suggest that "Optimized SVG" only removes `fill="remove"` since it is default, but keeps any other value.

Revision history for this message
Jehan (jehan-marmottard) wrote :

Oh actually I realized what Inkscape did and why some <animate*> still had a fill attribute whereas most didn't. My SVG had a whole bunch of <animate*> tags all using the same fill="freeze" value. So Inkscape grouped them all under <g fill="freeze"></g>. Then when I had a few fill="remove", it just kept these in the tag themselves.

As far as I understand the spec, this is not supposed to work, and Inkscape is therefore wrong to optimize this way. The spec gives a default value of "remove" and does not say that any <animate*> tag would use the value from the parent. Grouping them is useless.

Revision history for this message
Mc (mc...) wrote :

Hi,
The "optimized svg" capability in inkscape is provided by scour: https://github.com/scour-project/scour
The next inkscape version will include a more recent release of scour; can you test your problem with it; and, if it persists, post to their issue tracker ?

Thanks.

jazzynico (jazzynico)
tags: added: exporting extensions-plugins
Revision history for this message
Jehan (jehan-marmottard) wrote :

I can see scour is provided in the inkscape package on Fedora (inkscape-0.91-25.fc24.x86_64). Do you know if this is possible to switch to a user-installed scour? I could install the last release with pip. Actually I already did and there is no difference (which means either the last version of scour does not fix the issue, or Inkscape does not pick up the pip-installed release).

I also tried the dev flatpak of Inkscape (the nightly provided by Flatpak developers), but it apparently does not embed scour so the export failed (and it did not pick up the pip-installed scour either, this time maybe because of the sandbox?).

Do I have alternatives? Or should I wait a release, or build Inkscape (this last one would have to wait a bit, because I can't make the time for this right now)?

For info, there is a workaround, by making sure the box "Create groups for similar attributes" is unchecked in the Optimized SVG dialog.
Of course, this is not a suitable solution since scour should make the difference between attributes which can work by using the parent value, and attributes which don't.

Revision history for this message
jazzynico (jazzynico) wrote :

For testing, you can use the scour script installed with pip directly (in the terminal) with an Inkscape SVG file and see how the optimized file renders.

Revision history for this message
Jehan (jehan-marmottard) wrote :

Tested with:

> scour --create-groups input.svg -o output.svg

It is not fixed as of scour 0.35.
Bug report: https://github.com/scour-project/scour/issues/123

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.