Created attachment 119981 [details] Import SVG stretches in Krita SUMMARY I imported an SVG file from Affinity Designer to Krita. Whenever I import the files the image looks stretched. I have set the dpi in Krita as "100" STEPS TO REPRODUCE 1. exported a simple shape in SVG format in Affinity designer 2. imported the SVG in Krita 3. Set the preferred resolution as "100" 4. The file is stretched (please check the screenshots) OBSERVED RESULT EXPECTED RESULT SOFTWARE/OS VERSIONS Windows: Windows 10 Pro 64Bit ADDITIONAL INFORMATION Krita build: 4.2.0-alpha (git 220be8f) [May 11, 2019]
Can you please open it also in Inkscape and check if it appears stretched there, too? Also could you please attach the file here?
Created attachment 119982 [details] Hexagon - SVG File Hi, Kindly find attached the SVG File, that I opened with Krita. Thank You
Created attachment 119983 [details] Inkscape SVG file import test - works fine I tried to import the file in Inkscape. It works fine with the exact measurements. Please check the screenshot.
Created attachment 119986 [details] SVG export from Krita to Affinity Works fine Hi, I tried creating a simple shape in Krita and exported the file in SVG. Then I Imported the file in Affinity Designer. SVG export from Krita works fine. Only the SVG import is not working properly.
And I have a question. Why the vector shape edges are pixelating in Krita? Is it a bug? please check the above attached screenshot. [attachment 119986 [details]]
The problem seems to be that Krita reads the property "viewBox" to set the aspect ratio which is wrong. Other programs interpret the "viewBox" as the real pixel size of the image, like the framed window we can see trough. About the pixels in krita. this is not a bug, Krita is a raster image based painting program. And the "viewport" of krita is pixel based. In this way to show you the vector it "rasters" (converts to pixel representation" the vector reprentation) If you don't like to see pixels, use more pixels, that is, make a bigger image. Vector programs does not show pixel while editing, but after exporting to png/jpg,/tiff you will see the same pixels as they need to "raster" that vector shape also.
I understand. Thanks for the quick response.
Git commit 9fb11a3ed3a1b6ab34c94ea7dcf76d4c118c71cc by Ivan Yossi. Committed on 03/10/2019 at 20:13. Pushed by ivany into branch 'master'. Fix wrong aspect ratio on SVG Load We incorrectly treated the absence of preserveAspectRatio as set to "none". Svg specification states the initial value of this property should be "xMidYMid meet". in case there is no property we now use the initial value instead of ignoring. Updated TestSvgParser cases to use "none" so the resulting shape corresponds to the old behaviour. M +3 -4 libs/flake/svg/SvgUtil.cpp M +7 -0 libs/flake/tests/TestSvgParser.cpp https://invent.kde.org/kde/krita/commit/9fb11a3ed3a1b6ab34c94ea7dcf76d4c118c71cc
Git commit 218dbca4142a27e4f17de006d3f2297af9a8082c by Boudewijn Rempt, on behalf of Ivan Yossi. Committed on 04/10/2019 at 07:59. Pushed by rempt into branch 'krita/4.2'. Fix wrong aspect ratio on SVG Load We incorrectly treated the absence of preserveAspectRatio as set to "none". Svg specification states the initial value of this property should be "xMidYMid meet". in case there is no property we now use the initial value instead of ignoring. Updated TestSvgParser cases to use "none" so the resulting shape corresponds to the old behaviour. (cherry picked from commit 9fb11a3ed3a1b6ab34c94ea7dcf76d4c118c71cc) M +3 -4 libs/flake/svg/SvgUtil.cpp M +7 -0 libs/flake/tests/TestSvgParser.cpp https://invent.kde.org/kde/krita/commit/218dbca4142a27e4f17de006d3f2297af9a8082c