Bug 406124

Summary: svg rendered incorrectly
Product: [Applications] krita Reporter: Wren Turkal <wt>
Component: File formatsAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: halla
Priority: NOR    
Version: 4.1.7   
Target Milestone: ---   
Platform: macOS (DMG)   
OS: macOS   
Latest Commit: Version Fixed In:
Attachments: acquired from https://thenounproject.com/search/?q=transgender&i=1100922

Description Wren Turkal 2019-04-01 18:53:45 UTC
Created attachment 119201 [details]
acquired from https://thenounproject.com/search/?q=transgender&i=1100922

SUMMARY
SVG is not rendered properly. The svg is pretty simple, so I am hoping it can be converted to a minimal test case. Also, the svg renders correctly in Google Chrome and Safari.


STEPS TO REPRODUCE
1. Open the attached svg
2. Look at the render


OBSERVED RESULT
Incorrect render.


EXPECTED RESULT
Correct render.


SOFTWARE/OS VERSIONS
Windows: 
macOS: 4.1.7
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 5.11.1


ADDITIONAL INFORMATION
Krita
  Version: 4.1.7

Qt
  Version (compiled): 5.11.1
  Version (loaded): 5.11.1

OS Information
  Build ABI: x86_64-little_endian-lp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: darwin
  Kernel Version: 18.2.0
  Pretty Productname: macOS 10.14
  Product Type: osx
  Product Version: 10.14

OpenGL Info
  **OpenGL not initialized**
Comment 2 Dmitry Kazakov 2019-04-23 16:47:13 UTC
Git commit 18dfc4d8ee25dff0e125fbf7879a6c3298f21991 by Dmitry Kazakov.
Committed on 23/04/2019 at 16:46.
Pushed by dkazakov into branch 'master'.

Fix loading SVG with omitted commands

SVG supports omitting repeating command names. When checking for the
next command we should make sure we parse a case when it starts not
with a digit, but with a '.' sign.

M  +1    -1    libs/flake/KoPathShapeLoader.cpp

https://invent.kde.org/kde/krita/commit/18dfc4d8ee25dff0e125fbf7879a6c3298f21991
Comment 3 Dmitry Kazakov 2019-04-23 16:47:16 UTC
Git commit 779589e5afd7bcef0e75c33d8b86b9a63c115d54 by Dmitry Kazakov.
Committed on 23/04/2019 at 16:46.
Pushed by dkazakov into branch 'master'.

Try to estimate SVG document size by reading toplevel 'viewBox' tag

It seem to be a general convention in other applications, like
Firefox and QtSVG. The main purpose of such estimation is to
read correct aspect ratio.

M  +27   -2    libs/flake/svg/SvgParser.cpp

https://invent.kde.org/kde/krita/commit/779589e5afd7bcef0e75c33d8b86b9a63c115d54