Skip to content

`inkscape:auto-region` should be assumed `false` when importing non-Inkscape SVGs

Summary:

When opening SVG files which have not been created with Inkscape, the <filter> region values in the SVG file are ignored; instead, Inkscape overrides them with its default values, which may be wrong.

Steps to reproduce:

  • Create a filter where Inkscape's automatic region calculation results in too small a region (e.g. <feDisplacementMap> with <feTurbulence> input, see attachment FilterTooSmall.svg)
  • Run that file through an SVG optimizer, e.g. svgo (see attachment FilterTooSmall-svgo.svg). This removes the inkscape:auto-region="false" attribute, but leaves the region values untouched (i.e., it is displayed correctly in e.g. the browser)
  • Open that optimized file in Inkscape

What happened?

  • Inkscape ignores the <filter> width and therefore crops the filter output
  • Even when disabling "automatic region" in the UI, the filter region information remains wrong, as Inkscape has overridden it with its own defaults

What should have happened?

  • Inkscape should preserve filters imported as-is, unless it sees the file has been created by Inkscape.

One way to do this might be to have a inkscape:auto-region="false" default, instead of the current true, which neither prefers file contents nor appearance.

Sample attachments:

This one is displayed correctly in Inkscape:

FilterTooSmall.svg

This one displays correctly in the browser, but opening it in Inkscape clips the right-hand jags of the right-most line:

FilterTooSmall-svgo.svg

Trying to manually add the auto-region resulted in discovering #6666 (moved).

This would probably be less noticeable, if regions were not calculated too small, which seems to be discussed in inkscape#2618 . However, their still might be legitimate reasons to set the filter region to something manual (e.g., smaller on purpose), so this issue should still be addressed.

Version info

Inkscape 1.1.1 (3bf5ae0d25, 2021-09-20)

    GLib version:     2.68.4
    GTK version:      3.24.30
    glibmm version:   2.64.2
    gtkmm version:    3.24.5
    libxml2 version:  2.9.12
    libxslt version:  1.1.34
    Cairo version:    1.16.0
    Pango version:    1.48.10
    HarfBuzz version: 2.7.4
    Poppler version:  21.06.1

    OS version:       Ubuntu 21.10
Edited by Marcel Waldvogel
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information