[gimp/gimp-2-6] Bug 631885 - GIMP fails to import a path from SVG



commit 61ef9157d560e44bac9afb326290672b19663d1f
Author: Sven Neumann <sven gimp org>
Date:   Wed Oct 13 22:01:58 2010 +0200

    Bug 631885 - GIMP fails to import a path from SVG
    
    If a moveto is followed by multiple pairs of coordinates, the
    subsequent pairs are supposed to be treated as implicit lineto
    commands.
    
    The parser used to ignore this part of the SVG specification and
    treated subsequent pairs of coordinates as moveto commands (which
    is correct in general, but for moveto commands there is this
    explicit exception of the general rule).
    (cherry picked from commit beef765b4f4d0174f6886964b147f315b2f9b499)

 app/vectors/gimpvectors-import.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/app/vectors/gimpvectors-import.c b/app/vectors/gimpvectors-import.c
index ddb4a4e..ea52a7f 100644
--- a/app/vectors/gimpvectors-import.c
+++ b/app/vectors/gimpvectors-import.c
@@ -1542,6 +1542,11 @@ parse_path_do_cmd (ParsePathContext *ctx,
           ctx->strokes = g_list_prepend (ctx->strokes, ctx->stroke);
 
           ctx->param = 0;
+
+          /* If a moveto is followed by multiple pairs of coordinates,
+           * the subsequent pairs are treated as implicit lineto commands.
+           */
+          ctx->cmd = 'l';
         }
       break;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]