Matrix transformation problems

Bug #1459795 reported by floriankeim
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Invalid
Undecided
Unassigned

Bug Description

I had some trouble with matrix transformation:

1) If I open the attached files they look OK, but if I open one file and copy the other one in it (drag&drop), the transformation looks wrong (and the image is displayed in a strange way with the selection box bigger than the image).

2) When the transformed image is moved and snaps e.g. to an edge, the transformation is being destroyed.

This if for Windows 7, Inkscape 0.91

I generated the svg files myself.

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

Please add information about OS/platform and Inkscape version (see Inkscape menu 'Help > About Inkscape') to the bug description, thank you.

Any information you could provide about how these SVG files are being created? The <image> element in Image1.svg lacks the 'preserveAspectRatio' attribute and thus defaults to "xMidYMid' which enforces uniform scaling of the image inside its viewport).

See also:
http://www.w3.org/TR/SVG11/coords.html#PreserveAspectRatioAttribute

Changed in inkscape:
status: New → Incomplete
tags: added: bitmap
Revision history for this message
su_v (suv-lp) wrote :

On 2015-05-28 21:11 (+0200), DeepKling wrote:
> 2) When the transformed image is moved and snaps e.g. to an edge,
> the transformation is being destroyed.

Transformations on <image> elements are optimized (whenever possible) by default in Inkscape (e.g. whenever an update of the transformation or of the object's size/geometry is triggered) - you can change this in the preferences (note though that the changed behavior for transformations to use/store preserved transforms will affect all types of objects, not just bitmap images).

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

Another option to keep the matrix() transformation as preserved transformation for the bitmap image would be - (in the original, externally created SVG document) - to wrap the image into a <g> element, and to apply the matrix() transformation to the group. This will then "work" in Inkscape even if the <image> has the default 'xMidYMid' value for 'preserveAspectRatio' (since the group will be transformed), and will also "survive" copy&paste into a new document, or otherwise transforming (e.g. translating aka moving) the group within the original document.

Revision history for this message
floriankeim (floriankeim) wrote :

 I hope the "preserveAspectRatio" attribute is not mandatory, so that I'm not the only source for the problems ;-)
I'll try your suggestions, thank you so much for the help!

description: updated
su_v (suv-lp)
Changed in inkscape:
status: Incomplete → New
Revision history for this message
Jonathan Hofinger (jhofinger) wrote :

The cause of this is definitely the missing "preserveAspectRatio" attribute. It causes the larger bounding box, which is expected by the specification, since the attribute defaults to "xMidYMid" (i.e. do preserve aspect ratio). The rendering quirk has been moved to https://gitlab.com/inkscape/inbox/issues/1529.

Closed by: https://gitlab.com/jhofinger

Changed in inkscape:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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