Author Topic: Image's bounding box does transform faithfully, image doesn't.  (Read 1991 times)

March 25, 2018, 01:39:58 AM
Read 1991 times

Justme

  • Sr. Newbie

  • Offline
  • **

  • 3
The image's bounding box is transformed while the image itself always stubbornly keeps its aspect ratio.
I don't see any option to change this behavior, by right clicking on the image, or on the menu.
Even the properties menu behaves the same, despite the "scale proportionally" option being disabled.

Sorry if I'm asking something outside of the capabilities of the software, or something completely out of the ordinary,
if all Inkscape users want their images scaled proportionally, but is there a solution for my weird needs?

Here's Inkscape's image transformation in action:








  • Inkscape 0.92.2 (5c3e80d, 2017-08-06)
  • Windows 7 Home Premium

March 25, 2018, 04:56:08 AM
Reply #1

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
Hi.

It seems you are editing an svg coming outsude inkscape -there are options in the svg specs to preserve the aspect ratio of a raster image.
Inkscape can render that as seen but there is no gui for that as far as I know (section in the properties/object browser perhaps?).

Then, if you open the xml editor (Shift+Ctrl+X) you can access every property of the objects and can edit out the preserveaspectratio setting.

Previously I've seen an svg attached here showing a stroke which's width wouldn't scale, always jumping back to 1 px regardless zooming level -the xml editor could solve the problem in no time.

March 25, 2018, 06:20:33 AM
Reply #2

Justme

  • Sr. Newbie

  • Offline
  • **

  • 3
Then, if you open the xml editor (Shift+Ctrl+X) you can access every property of the objects and can edit out the preserveaspectratio setting.

Previously I've seen an svg attached here showing a stroke which's width wouldn't scale, always jumping back to 1 px regardless zooming level -the xml editor could solve the problem in no time.
There is no preserveaspectratio option in xml editor:

  • Inkscape 0.92.2 (5c3e80d, 2017-08-06)
  • Windows 7 Home Premium

March 25, 2018, 06:42:40 AM
Reply #3

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
Hmm not sure about the aspect ratio but probably it's caused by the height value is fixed to 50 and the width to 120.
Would try extracting the image with the extension and embedding it again to see how it looks with the default settings.

March 25, 2018, 02:20:16 PM
Reply #4

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
Inkscape works that way for me, too.

You can set preserveAspectRatio to none to fix this (open XML-Editor, select object, set attribute as in screenshot):

Bildschirmfoto_2018-03-25_23-19-22.png
*Bildschirmfoto_2018-03-25_23-19-22.png
(40.71 kB . 619x294)
(viewed 236 times)


https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/preserveAspectRatio

March 26, 2018, 01:10:07 AM
Reply #5

Justme

  • Sr. Newbie

  • Offline
  • **

  • 3
Hmm not sure about the aspect ratio but probably it's caused by the height value is fixed to 50 and the width to 120.
Would try extracting the image with the extension and embedding it again to see how it looks with the default settings.

That worked, thanks. I right-clicked, extracted the image, then drag & dropped it in and nothing else was needed.

That bug though, should be corrected.  Supporting the SVG format should not have fundamental variations in behavior -it should be consistent.
  • Inkscape 0.92.2 (5c3e80d, 2017-08-06)
  • Windows 7 Home Premium

March 26, 2018, 11:09:47 PM
Reply #6

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
Supporting the SVG format should not have fundamental variations in behavior -it should be consistent.

Preserved transformations are the default svg directive whereas every practical use would require optimized -thinking of how strokes are handled upon transformations I'd rather not want to be 100% about the specs.
And from this post I get the idea inkscape did what was requested in the svg file -sticking with the set height/width values of the image object which was confusing beforehand.

Anyway, glad you could solve the problem!