Inkscape.org
Beginners' Questions Figures only partially importing
  1. #1
    Esme_ Esme_ @Esme_

    I have a number of svg files that, if I open directly, show as I would expect.  However, when I try to import them into an existing file (to avoid getting a white background when I copy and paste) I only get part of the image.  I have attached one of the files that I am having this trouble with, with a side-by-side example of what the file looks like if I open it by double-clicking on the file vs using import.

    Any ideas for how I can fix this?  It is happening with a lot of images I want to use.

    Ian Symbol Acanthurus Achilles
    Screen Shot 2020 02 12 At 18.24.10
  2. #2
    Freezr Freezr @freezr
    *

    Your file is imported partially, if you go on outline view what is not imported or associated properly are the color. And if you paste your file inside the same document the color are restored properly. I am investigating...

    EDIT

    I found your issue. For some reason your gradients have a very long name:

    ian_symbols_2b034…4393f4d5d0c3f82fb

    Probably there is a limit of characters that you can use to name a gradient, I don't know why you have these weird names but if you want avoid problems for the future you have to find a way to rename those. Unfortunately renaming the gradients and the node associated didn't work out, there must be more instances of the same gradient that you have to change at once, a text editor may help; by default the gradients use tre numbers (maybe also three characters) to be named.

  3. #3
    Aero Aero @Aero◻️

    Inkscape have this issue when gradients is not in Defs. Once all the gradients is moved into Defs the issue is gone. A bug if you ask me. I use other software for a quick fix.

  4. #4
    Freezr Freezr @freezr

    However I just copied the graphic into a new one, saved, and it fixed the issue. For me there was some malformation into the svg declaration, when I tried to use SVGO it failed hence the file was somehow corrupted.

    @Esme_ to make the background transparent modify it in the document properties.

  5. #5
    Aero Aero @Aero◻️

    The testfile is not corrupted, it opens just fine in all browsers, Inkscape and other software. 

    My point is, this file should look the same in Inkscape also when imported, regardless of the gradients being stored in Defs or not.

  6. #6
    Freezr Freezr @freezr
    *

    @Aero

    That file has the gradients outside the node <defs></defs>, exactly as you said, and if it has been created with Inkscape then has been processed by some code cleaner or simply was never created with inkscape to begin...

     

    Svg Comparison
  7. #7
    Tyler Durden Tyler Durden @TylerDurden

    The SVG specification advises that referenced elements should properly be placed in the defs

    It is recommended that, wherever possible, referenced elements be defined inside of a ‘defs’ element. Among the elements that are always referenced:  ‘altGlyphDef’‘clipPath’‘cursor’‘filter’‘linearGradient’‘marker’‘mask’‘pattern’‘radialGradient’ and ‘symbol’. Defining these elements inside of a ‘defs’ element promotes understandability of the SVG content and thus promotes accessibility.

    We can say that the original image, while not corrupted per se, does not follow the specification, whereas Inkscape has a mandate to follow the spec.

    The objects can be cut and pasted into a new layer and new gradients will be placed into the Defs, however the original gradients (now unused) will still be in the "body" of the document  and will not be cleaned.

    Also helpful for the OP might be the recommended settings for vector copy/paste in Mac X11:  https://inkscape.org/learn/faq/#copypaste-rasterizes-objects

     

    TD

  8. #8
    Esme_ Esme_ @Esme_

    Thanks @Gnuserland - copying into a new file and saving fixed the issue - definitely easier for me than figuring out how to fix the naming of the gradients (I'm definitely a beginner with Inkscape).  The files all come from an online archive so I'm not going to be able to change their naming practices.

Inkscape Inkscape.org Inkscape Forum Beginners' Questions Figures only partially importing