Matrix transform on image produces bad rendering with PreserveAspectRatio missing or inequal none (e.g. xMidYMid)

Migrated from: https://bugs.launchpad.net/inkscape/+bug/1459795

Steps to reproduce:

  • open attached file (image with matrix transform applied)
  • scale with handle in the bottom center of the bounding box (shrink, not enlarge)

What happened?

after step 4: massive rendering artifacts at the sides (PNG export):

Image_1

Wrapping the image removes the artifacts, but behaves as preserveAspectRatio=none.

The cause of this is most definitely the missing preserveAspectRatio attribute. Adding it with preserveAspectRatio=none (default behavior of Inkscape for images) removes the artifacts, but also stretches the image.

Also I can replicate the behavior with another image when I remove this attribute in the XML editor (i.e. setting it to the SVG default value).

Since preserveAspectRatio=xMidYMid is the default value for this attribute (https://developer.mozilla.org/de/docs/Web/SVG/Attribute/preserveAspectRatio), Inkscape should support this without creating rendering artifacts.

The same artifacts appear with preserveAspectRatio=xMinYMin (and probably all other values of this attribute inequal none)

What should have happened?

Image is simply scaled horizontally / vertically

Inkscape Version and Operating System:

  • Inkscape Version: 1.1-dev (03ae7f7, 2020-01-04)
  • Operating System: Windows 10
  • Operating System version: 10.0.18362

Example file from original Launchpad bug:

Image1_smaller.svg

Summary of comments:

originally reported on Inkscape 0.92.?, Windows 7.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information